Production ITerminal backed by Console. 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 | Dispose () |
| Restores raw mode and alternate screen, completes the input observable, and disposes the SIGWINCH registration. | |
| void | EnableMouse (MouseMode mode=MouseMode.ButtonEvents) |
| Enable terminal mouse tracking.Events arrive via Input as MouseInputEvent. No-op if already enabled or not supported. | |
| void | EnterAlternateScreen () |
| Enter alternate screen buffer (saves scroll-back). | |
| void | EnterRawMode () |
| Enter raw / no-echo mode.Keyboard events are delivered via Input without waiting for newline. Ctrl+C is delivered as KeyMsg, not SIGINT. | |
| 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.Called by the renderer at most once per frame (≤60 fps). | |
| void | SetCursorPosition (int col, int row) |
| Appends an ANSI cursor-position escape sequence (converts 0-based col/row to 1-based ANSI). | |
| void | SetCursorVisible (bool visible) |
| Shows or hides the hardware cursor by writing directly to the terminal (bypasses the render buffer). | |
| 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.Does not flush to the physical terminal until Flush() is called. | |
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 window is resized (SIGWINCH on Unix). | |
| Events inherited from ConsoleForge.Terminal.ITerminal | |
| EventHandler< TerminalResizedEventArgs > | Resized |
| Raised when the terminal is resized. | |
Production ITerminal backed by Console.
Handles ANSI output, raw mode (Unix/Windows), alternate screen, and resize events. On Unix: raw mode via termios, resize via SIGWINCH. On Windows: raw mode via kernel32 console mode, resize via background polling thread.
| void ConsoleForge.Terminal.AnsiTerminal.Dispose | ( | ) |
Restores raw mode and alternate screen, completes the input observable, and disposes the SIGWINCH registration.
Safe to call multiple times.
|
get |
Observable stream of input events (keypresses, resize events).
The runtime subscribes to this; application code does not.
Implements ConsoleForge.Terminal.ITerminal.