Class: Terminal

Terminal

new Terminal()

Terminal is the glue between a TerminalState and the escape sequence interpreters.
Source:

Methods

callHandler(type, cmd)

calls an handler
Parameters:
Name Type Argument Description
type string one of the following types:
  • chr: interprets special characters (such as \r or \b)
  • esc: interprets simple escape characters starting with \x1b
  • csi: interprets CSI escape sequences
  • sgr: interprets SGR escape sequences
  • dcs: interprets DCS escape sequences
  • mode: interprets mode sequences
  • osc: interpretes OSC escape sequences
cmd string command to execute
... array <repeatable>
passed to the command function
Source:

dom(element, options)

sets up a DOM element as Terminal in- and output
Parameters:
Name Type Description
element a DOM element node
options options field
Source:
Returns:
a terminal input which can be used to send data to a pty

parseCsi(chunk) → {Object}

reads a CSI command sequence from a chunk of data
Parameters:
Name Type Description
chunk string a chunk of data to parse
Source:
Returns:
Type
Object

parseDcs(chunk) → {Object}

reads a OSC command sequence from a chunk of data
Parameters:
Name Type Description
chunk string a chunk of data to parse
Source:
Returns:
Type
Object

parseOsc(chunk) → {Object}

reads a OSC command sequence from a chunk of data
Parameters:
Name Type Description
chunk string a chunk of data to parse
Source:
Returns:
Type
Object

toString(format)

will give a string representation of the terminal
Parameters:
Name Type Description
format one of 'html', 'ansi', 'plain' if not present, TermState#toString will be called.
Source:
Returns:
string representation of the terminal

write()

Takes a chunk of data, interprets its escape sequences, and fills backend state
Source:
See: