Terminal abstracts an implementation of a 2-D terminal. A terminal consists of a number of cells.
| 25 | // Terminal abstracts an implementation of a 2-D terminal. |
| 26 | // A terminal consists of a number of cells. |
| 27 | type Terminal interface { |
| 28 | // Size returns the terminal width and height in cells. |
| 29 | Size() image.Point |
| 30 | |
| 31 | // Clear clears the content of the internal back buffer, resetting all |
| 32 | // cells to their default content and attributes. Sets the provided options |
| 33 | // on all the cell. |
| 34 | Clear(opts ...cell.Option) error |
| 35 | // Flush flushes the internal back buffer to the terminal. |
| 36 | Flush() error |
| 37 | |
| 38 | // SetCursor sets the position of the cursor. |
| 39 | SetCursor(p image.Point) |
| 40 | // HideCursos hides the cursor. |
| 41 | HideCursor() |
| 42 | |
| 43 | // SetCell sets the value of the specified cell to the provided rune. |
| 44 | // Use the options to specify which attributes to modify, if an attribute |
| 45 | // option isn't specified, the attribute retains its previous value. |
| 46 | SetCell(p image.Point, r rune, opts ...cell.Option) error |
| 47 | |
| 48 | // Event waits for the next event and returns it. |
| 49 | // This call blocks until the next event or cancellation of the context. |
| 50 | // Returns nil when the context gets canceled. |
| 51 | Event(ctx context.Context) Event |
| 52 | |
| 53 | // Close closes the underlying terminal implementation and should be called when |
| 54 | // the terminal isn't required anymore to return the screen to a sane state. |
| 55 | Close() |
| 56 | } |
no outgoing calls
no test coverage detected