A Browser Terminal framework for Xterm js
I built this so I could build terminals in the browser extensibly. It's a light wrapper around xterm js.
Installation
npm i xterm-browser
Usage
Wherever you would normally set up your xterm js terminal:
const BrowserTerminal = Terminal let term = {}terminalterminal // sets up the parser and event listeners.
Writing to the terminal
xterm-browser extends xterm js, so you can call methods directly:
terminal
You can also use the Terminal.format utility to change colors and text backgrounds:
terminalterminalterminalterminalterminal
NOTE: styles and colors will overlap or override each other without a call to Terminal.format.reset('all')
.
Commands
You listen for command events from the dispatcher. The dispatcher will emit events using the first word (separated by a space) of the line submitted.
terminaldispatcher
The data
object is from yargs-parser.
TODO
A whole heck of a lot. See the Issues tab.