Terminal (from Box)

A box which spins up a pseudo terminal and renders the output. Useful for writing a terminal multiplexer, or something similar to an mc-like file manager. Requires term.js and pty.js to be installed. See example/multiplex.js for an example terminal multiplexer.

Options

  • Inherits all from Box.
  • handler - Handler for input data.
  • shell - Name of shell. $SHELL by default.
  • args - Args for shell.
  • cursor - Can be line, underline, and block.
  • terminal - Terminal name (Default: xterm).
  • env - Object for process env.
  • Other options similar to term.js'.

Properties

  • Inherits all from Box.
  • term - Reference to the headless term.js terminal.
  • pty - Reference to the pty.js pseudo terminal.

Events

  • Inherits all from Box.
  • title - Window title from terminal.
  • Other events similar to ScrollableBox.

Methods

  • Inherits all from Box.
  • write(data) - Write data to the terminal.
  • screenshot([xi, xl, yi, xl]) - Nearly identical to element.screenshot, however, the specified region includes the terminal's entire scrollback, rather than just what is visible on the screen.
  • Other methods similar to ScrollableBox.

Last update: February 22, 2020