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. 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
    – dmi3y
    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. 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.

5
  • 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
    Dec 11, 2012 at 16:14
  • @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. Dec 11, 2012 at 16:18
  • 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.
    – jabalsad
    Dec 11, 2012 at 16:23
  • 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.
    – jabalsad
    Dec 11, 2012 at 16:24
  • 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? Dec 12, 2012 at 8:09
2

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

1

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

0

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

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.