Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the best way to simulate a DOS or Terminal screen in a web page?

Tags:

People also ask

What is jQuery terminal?

jQuery Terminal Emulator is a plugin for creating command line interpreters in your applications. It can automatically call JSON-RPC service when a user types commands or you can provide your own function in which you can parse user commands. It's ideal if you want to provide additional functionality for power users.


I'm finding this hard to even conceptualize. The easy way would be to have a large textarea element taking up most of the screen, with a small text input element below it. The player would type in commands, and the output would show up in the textarea.

Problem is, I want the input to be integrated fully. Think of a DOS screen. There is the bracket prompt, >, after which you type in a command. Press Enter and the output is shown below it, followed by another > prompt for the next command. Input is not separate, visually, from output. An example of what I'd like to accomplish can be seen here: http://www.youtube.com/watch?v=UC_FrikiZdE (except instead of using the mouse to choose commands, they can be entered in).

How would I go about doing that in HTML (using JavaScript/jQuery for handling input/output)? I'm thinking perhaps everything is done in an editable textarea, but the Backspace button cannot erase anything from the > prompt and beyond, only text that has been entered in.

What is the easiest way to do this? I haven't been able to find any demonstrations or tutorials online. Can anybody point me to any that I may have missed? Thanks.