26

I've got a text file that contains terminal output which includes all kinds of character codes such as moving the cursor around, etc. How can I render this properly in a browser?

3
  • 1
    Hm, you could mess with and try to extract the terminal emulator from jslinux. Commented Dec 11, 2012 at 14:58
  • look at 9 cloud ide, they do pretty much good work with in browser termilal github.com/ajaxorg/cloud9 Commented Dec 11, 2012 at 14:58
  • @jabalsad I could try and provide a more detailed answer if you had any code or file for sampling. Commented Dec 11, 2012 at 15:42

4 Answers 4

15

There are sevral options that I've found based on terminal emulation using Javascript:

The first option seems to be the closest solution to what you need.

Sign up to request clarification or add additional context in comments.

5 Comments

The GateOne link points to the same URL as jQuery Terminal Plugin. Thanks for your answer, I'll have to evaluate to see what they can and can't do.
@jabalsad Fixed, thanks for the heads up. BTW If you post a sample file I might be able to add some explanation code to the answer.
Some of the control characters I am talking of is \[00;01H or \[16;00H . I'll have to get back to you about an actual sample file, but that should be irrelevant since all terminal emulators interpret control characters the same way.
So far, the two closest matches seem to be GateOne and shellinabox since they deal with actual linux terminals. The other two options just give you a terminal-like interface in a browser.
My answer might not be relevant and you're looking for some kind of parser. Does your solution have to be browser based? Or, can it involve some server side scripting?
3

https://github.com/drudru/ansi_up probably is what you need, it will render any termial output to html

Comments

1

I used term.js, bone.io, expres.io for terminal emulation. Its working pretty well.

Comments

0

https://github.com/thlorenz/hypernal Renders terminal output as html to simplify reusing server side modules in the browser.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.