Thin abstraction over a physical terminal. More...
Public Member Functions | |
| void | Clear () |
| Clear the internal output buffer (not the physical terminal). | |
| void | DisableMouse () |
| Disable mouse tracking. No-op if not enabled. | |
| void | EnableMouse (MouseMode mode=MouseMode.ButtonEvents) |
| Enable terminal mouse tracking. | |
| void | EnterAlternateScreen () |
| Enter alternate screen buffer (saves scroll-back). | |
| void | EnterRawMode () |
| Enter raw / no-echo mode. | |
| void | ExitAlternateScreen () |
| Exit alternate screen buffer and restore previous content. | |
| void | ExitRawMode () |
| Restore cooked (normal) input mode. | |
| void | Flush () |
| Flush the buffered output to the physical terminal. | |
| void | SetCursorPosition (int col, int row) |
| Move the terminal cursor to the given zero-based column and row. | |
| void | SetCursorVisible (bool visible) |
| Show or hide the terminal hardware cursor. | |
| void | SetTitle (string title) |
| Set the terminal window title. No-op if not supported. | |
| void | Write (string ansiText) |
| Write a pre-rendered ANSI string to the terminal output buffer. | |
Properties | |
| int | Height [get] |
| Current terminal height in rows. | |
| IObservable< InputEvent > | Input [get] |
| Observable stream of input events (keypresses, resize events). | |
| int | Width [get] |
| Current terminal width in columns. | |
Events | |
| EventHandler< TerminalResizedEventArgs > | Resized |
| Raised when the terminal is resized. | |
Thin abstraction over a physical terminal.
Production implementation: AnsiTerminal (uses System.Console + ANSI codes). Test implementation: VirtualTerminal (in-memory buffer, injectable input).
| void ConsoleForge.Terminal.ITerminal.EnableMouse | ( | MouseMode | mode = MouseMode.ButtonEvents | ) |
Enable terminal mouse tracking.
Events arrive via Input as MouseInputEvent. No-op if already enabled or not supported.
Implemented in ConsoleForge.Terminal.AnsiTerminal.
| void ConsoleForge.Terminal.ITerminal.EnterRawMode | ( | ) |
Enter raw / no-echo mode.
Keyboard events are delivered via Input without waiting for newline. Ctrl+C is delivered as KeyMsg, not SIGINT.
Implemented in ConsoleForge.Terminal.AnsiTerminal.
| void ConsoleForge.Terminal.ITerminal.Flush | ( | ) |
Flush the buffered output to the physical terminal.
Called by the renderer at most once per frame (≤60 fps).
Implemented in ConsoleForge.Terminal.AnsiTerminal.
| void ConsoleForge.Terminal.ITerminal.Write | ( | string | ansiText | ) |
Write a pre-rendered ANSI string to the terminal output buffer.
Does not flush to the physical terminal until Flush() is called.
Implemented in ConsoleForge.Terminal.AnsiTerminal.
|
get |
Observable stream of input events (keypresses, resize events).
The runtime subscribes to this; application code does not.
Implemented in ConsoleForge.Terminal.AnsiTerminal.
| EventHandler< TerminalResizedEventArgs> ConsoleForge.Terminal.ITerminal.Resized |
Raised when the terminal is resized.
On Unix, triggered by SIGWINCH. The runtime re-queries Width/Height and sends WindowResizeMsg.