Fork me on GitHub

w3term - Javascript Terminal

This terminal is intended to support the emulation of an interactive shell like many scripting languages or the operating systems themselves provide.

Note that it is now also easy to create custom styles for your terminal, see this page for more information on styling.

Usage:

For this demonstration, some example commands have been implemented (you can write your own ones using Javascript):

Features

Dependencies

Tested in:

Documentation

Usage example

In order to create a terminal, you need to include the w3term.js and w3term.css files in your HTML file. You can also use the minified versions inside the dist directory.

A terminal is created by calling the function w3term with a dom element as an argument (in this case a div). Every element that is not a div is automatically converted into a div.

var term = w3term(document.getElementById("myId"),
    {
        prompt : "$ ",
        processCommand : function(cmd) {
            // implement your command logic here
        }
    }
);

term.w3term.println("Welcome to w3term"); // print some text into the terminal

The second parameter is an object that contains several options. It is optional and can be omitted if the terminal should be created with default options. A list of possible options is described below.

Method Summary

The following methods can be called via element.w3term.<methodName>(...):