Fork JQuery Terminal Emulator on GitHub

Summary

JQuery Terminal Emulator is a plugin for creating command line interpreters in your applications. It can automatically call JSON-RPC service when user type commands or you can provide an object with methods, each method will be invoke on user command. Object can have nested objects which will create nested interpreter. You can also use a function in which you can parse user command by your own. It′s ideal if you want to provide additional functionality for power users. It can also be used as debuging tool.

Features

Demo

This is simple demo using javascript interpreter. (If cursor is not blinking - click on terminal to activate it) You can type any javascript expression, there are two debug function dir (like in python).

You can use JQuery ‘$’ function to manipulate the page. You also have access to this terminal in ‘term’ variable. Try ‘dir(term)’ or ‘term.signature()’.

Javascript code:

jQuery(function($, undefined) {
    $('#term_demo').terminal(function(command) {
        if (command !== '') {
            try {
                var result = window.eval(command);
                if (result !== undefined) {
                    this.echo(new String(result));
                }
            } catch(e) {
                this.error(new String(e));
            }
        } else {
           this.echo('');
        }
    }, {
        greetings: 'Javascript Interpreter',
        name: 'js_demo',
        height: 200,
        prompt: 'js> '
    });
});

Download

Complete source with examples from github

Or just the files:

Installation

You can dowload files locally or use:

Bower:

bower install jquery.terminal

NPM:

npm install --save jquery.terminal

then you can include the scripts in your html

<script src="js/jquery.terminal-1.9.0.min.js"></script>
<script src="js/jquery.mousewheel-min.js"></script>
<link href="css/jquery.terminal-1.9.0.min.css" rel="stylesheet"/>

You can also grab the files using CDN:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/1.9.0/js/jquery.terminal.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/1.9.0/css/jquery.terminal.min.css" rel="stylesheet"/>

or

<script src="https://cdn.jsdelivr.net/npm/jquery.terminal@1.9.0/js/jquery.terminal.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/jquery.terminal@1.9.0/css/jquery.terminal.min.css" rel="stylesheet"/>

License

JQuery Terminal Emulator plugin is released under MIT license.

It contains:

Comments

Use terminal to leave a comment. Click to active. If you have a question you can create an issue on github, ask on stackoverflow (you can use jquery-terminal tag) or send email to jcubic@jcubic.pl. You can also send email with SO question or jump to the chat.

If you have feature request you can also add GitHub issue.

If you've found an issue with website you can add issue to jquery.terminal-www repo.