Documentation
¶
Overview ¶
Package terminalapi defines the API of all terminal implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error string
Error is an event indicating an error while processing input.
type Event ¶
type Event interface {
// contains filtered or unexported methods
}
Event represents an input event.
type Mouse ¶
type Mouse struct {
// Position of the mouse on the terminal.
Position image.Point
// Button identifies the pressed button if any.
Button mouse.Button
}
Mouse is the event used when the mouse is moved or a mouse button is pressed. Implements terminalapi.Event.
type Terminal ¶
type Terminal interface {
// Size returns the terminal width and height in cells.
Size() image.Point
// Clear clears the content of the internal back buffer, resetting all
// cells to their default content and attributes. Sets the provided options
// on all the cell.
Clear(opts ...cell.Option) error
// Flush flushes the internal back buffer to the terminal.
Flush() error
// SetCursor sets the position of the cursor.
SetCursor(p image.Point)
// HideCursos hides the cursor.
HideCursor()
// SetCell sets the value of the specified cell to the provided rune.
// Use the options to specify which attributes to modify, if an attribute
// option isn't specified, the attribute retains its previous value.
SetCell(p image.Point, r rune, opts ...cell.Option) error
// Event waits for the next event and returns it.
// This call blocks until the next event or cancellation of the context.
Event(ctx context.Context) Event
}
Terminal abstracts an implementation of a 2-D terminal. A terminal consists of a number of cells.
Click to show internal directories.
Click to hide internal directories.