Emulator is a terminal emulator API. It implements the state machinery (escape parsing and so forth) associated with being a terminal emulator. The backend handles rendering the content, and some low level details. NOTE: This is not a committed interface yet, its entirely a work in progress.
| 37 | // |
| 38 | // NOTE: This is not a committed interface yet, its entirely a work in progress. |
| 39 | type Emulator interface { |
| 40 | // SetId sets our identity. |
| 41 | SetId(name string, version string) |
| 42 | |
| 43 | // SendRaw sends raw data to the consumer. This bypasses the normal encoding, |
| 44 | // so it should be used with caution. |
| 45 | SendRaw([]byte) |
| 46 | |
| 47 | // KeyEvent injects a keyboard event into the emulator, which will ultimately |
| 48 | // result in data being sent via SendRaw. |
| 49 | KeyEvent(ev KeyEvent) |
| 50 | |
| 51 | // ResizeEvent is called by a backend when the terminal has resized |
| 52 | // This will send in-band resize notifications if the client has requested them. |
| 53 | ResizeEvent(Coord) |
| 54 | |
| 55 | // MouseEvent is called by a backend to report mouse activity. |
| 56 | MouseEvent(ev MouseEvent) |
| 57 | |
| 58 | // FocusEvent is called by a backend to report that focus is gained (true) or lost (false). |
| 59 | FocusEvent(bool) |
| 60 | |
| 61 | // Drain waits until any queued but not processed input has finished processing. |
| 62 | // It also wakes the reader. |
| 63 | Drain() error |
| 64 | |
| 65 | // Start starts processing. |
| 66 | Start() error |
| 67 | |
| 68 | // Stop stops processing. |
| 69 | Stop() error |
| 70 | |
| 71 | // Reader reads data from the emulator. These are bytes that would be transmitted |
| 72 | // to a remote party. |
| 73 | io.Reader |
| 74 | |
| 75 | // Writer writes data to the emulator. These are commands that the emulator should process. |
| 76 | io.Writer |
| 77 | } |
| 78 | |
| 79 | // Style represents the styling of a cell. |
| 80 | // This is an interface to prevent direct modification. |
no outgoing calls
no test coverage detected
searching dependent graphs…