9 Terminal API
Jakub Sobon edited this page 2019-03-03 18:47:35 -05:00

Doc Status

The terminalapi package exposes types that are common to all terminal implementations. This abstraction was created so that users of Termdash can choose which low-level terminal library they prefer.

The public API surface of this package consists of the following:

terminalapi.Terminal

All terminal implementations must implement this interface.

terminalapi.ColorMode

The ColorMode property specifies which colors can be displayed on the terminal and how are they addressed.

Refer to the following pages which provide a list of colors and their numbers:

Colors are set as options on terminal cells. Refer to the Cell API for more details.

terminalapi.Event

This interface represents an input terminal event, which can be one of the following events:

  • A keyboard event when a key is pressed.
  • A mouse event when a mouse button is pressed or the mouse wheel is rolled.
  • A terminal resize event when the size of the terminal window changes.
  • An error that occurs at the terminal layer or during event processing.