Pseudoterminal

Defines the interface of a terminal pty, enabling extensions to control a terminal.

Online Documentation

Properties

Link copied to clipboard
abstract var handleInput: (data: String) -> Unit?

Implement to handle incoming keystrokes in the terminal or when an extension calls Terminal.sendText. data contains the keystrokes/text serialized into their corresponding VT sequence representation.

Link copied to clipboard

An event that when fired allows changing the name of the terminal.

Link copied to clipboard
abstract var onDidClose: Event<JsInt?>?

An event that when fired will signal that the pty is closed and dispose of the terminal.

Link copied to clipboard

An event that when fired allows overriding the dimensions of the terminal. Note that when set, the overridden dimensions will only take effect when they are lower than the actual dimensions of the terminal (ie. there will never be a scroll bar). Set to undefined for the terminal to go back to the regular dimensions (fit to the size of the panel).

Link copied to clipboard
abstract var onDidWrite: Event<JsString>

An event that when fired will write data to the terminal. Unlike Terminal.sendText which sends text to the underlying child pseudo-device (the child), this will write the text to parent pseudo-device (the terminal itself).

Link copied to clipboard
abstract var setDimensions: (dimensions: TerminalDimensions) -> Unit?

Implement to handle when the number of rows and columns that fit into the terminal panel changes, for example when font size changes or when the panel is resized. The initial state of a terminal's dimensions should be treated as undefined until this is triggered as the size of a terminal isn't known until it shows up in the user interface.

Functions

Link copied to clipboard
abstract fun close()

Implement to handle when the terminal is closed by an act of the user.

Link copied to clipboard
abstract fun open(initialDimensions: TerminalDimensions?)

Implement to handle when the pty is open and ready to start firing events.