A basic Terminal idea in Javascript (Vanilla)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
LICENSE
README.md
term.css
term.js

README.md

Term.js

A basic Terminal idea in Javascript (Vanilla). This is just an idea I wrote from scratch, I tried to make a simple terminal in Javascript for an application that I made.

Features

  • Basic shell
  • Custom command interpreter
  • Pure javascript and withour dependencies
  • Command highlighting
  • Command history
  • Quoted arguments support (strings)
  • Suggestion and autocompletion
  • Tab keys and arrow keys movement
  • Output coloring (VT100 emulation or something like that)

Customized

Usage

    <link rel="stylesheet" href="term.css">
    <script src="term.js"></script>

Options

Term.js has only one option, that is the class for read and run the commands:

    var term = new Terminal(document.querySelector(".terminal"), {
        interpreterClass: MyCustomClass // The default is the DummyInterpreter
    });

Example

    window.addEventListener('load', () => {
        var terminal = new Terminal(document.querySelector(".terminal"));
        terminal.writeLine("***************************************");
        terminal.writeLine("* Welcome to Term.js                 *");
        terminal.writeLine("***************************************");
        terminal.start();
    });

I am adding more examples in termjs/examples folder.

Screenshots

Basic Old School

License

MIT