Class ConsoleTerminal
Real console-backed terminal implementation.
public class ConsoleTerminal : ICliTerminal
- Inheritance
-
ConsoleTerminal
- Implements
- Inherited Members
Properties
BackgroundColor
Current background colour.
public CliColor BackgroundColor { get; set; }
Property Value
CursorLeft
Current cursor column.
public int CursorLeft { get; }
Property Value
CursorTop
Current cursor row.
public int CursorTop { get; }
Property Value
CursorVisible
Cursor visibility.
public bool CursorVisible { get; set; }
Property Value
ForegroundColor
Current foreground colour.
public CliColor ForegroundColor { get; set; }
Property Value
KeyAvailable
Whether a key press is available without blocking.
public bool KeyAvailable { get; }
Property Value
Sink
Gets the render sink for this terminal, after resetting its tracked style state. The sink
is chosen by ColorMode and, under Auto,
detected terminal capability — the same policy as normal TigerConsole output.
public ICliRenderSink Sink { get; }
Property Value
State
Captures the terminal state needed for later restoration.
public ITerminalState State { get; }
Property Value
WindowHeight
Gets the terminal height, using a deterministic fallback when it cannot be read.
public int WindowHeight { get; }
Property Value
WindowWidth
Gets the terminal width, using a deterministic fallback when it cannot be read.
public int WindowWidth { get; }
Property Value
Methods
ClearLines(int, int, CliColor)
Clears a range of terminal rows using the supplied background colour.
public void ClearLines(int fromRow, int count, CliColor bgColor)
Parameters
ReadKey(bool)
Reads a key from the terminal.
public ConsoleKeyInfo ReadKey(bool intercept)
Parameters
interceptbool
Returns
RenderGrid(int, int, CliGrid)
Attempts to render a grid at the specified console coordinate. A frame may be skipped if
the terminal is unavailable or changes size during rendering.
public void RenderGrid(int x, int y, CliGrid grid)
Parameters
RestoreState(ITerminalState, int, int)
Restores a captured console state and clears the specified rendered region.
public void RestoreState(ITerminalState terminalState, int startRow, int height)
Parameters
terminalStateITerminalState- A state previously captured from this terminal.
startRowint- The first row of the rendered region.
heightint- The number of rows in the rendered region.
SetCursorPosition(int, int)
Attempts to move the console cursor to the specified coordinates.
public void SetCursorPosition(int left, int top)