Table of Contents

Class ConsoleTerminal

Namespace
ItTiger.TigerCli.Terminal
Assembly
ItTiger.TigerCli.dll
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

CliColor

CursorLeft

Current cursor column.
public int CursorLeft { get; }

Property Value

int

CursorTop

Current cursor row.
public int CursorTop { get; }

Property Value

int

CursorVisible

Cursor visibility.
public bool CursorVisible { get; set; }

Property Value

bool

ForegroundColor

Current foreground colour.
public CliColor ForegroundColor { get; set; }

Property Value

CliColor

KeyAvailable

Whether a key press is available without blocking.
public bool KeyAvailable { get; }

Property Value

bool

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

ICliRenderSink

State

Captures the terminal state needed for later restoration.
public ITerminalState State { get; }

Property Value

ITerminalState

WindowHeight

Gets the terminal height, using a deterministic fallback when it cannot be read.
public int WindowHeight { get; }

Property Value

int

WindowWidth

Gets the terminal width, using a deterministic fallback when it cannot be read.
public int WindowWidth { get; }

Property Value

int

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

fromRow int
count int
bgColor CliColor

ReadKey(bool)

Reads a key from the terminal.
public ConsoleKeyInfo ReadKey(bool intercept)

Parameters

intercept bool

Returns

ConsoleKeyInfo

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

x int
The zero-based column.
y int
The zero-based row.
grid CliGrid
The grid to render.

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

terminalState ITerminalState
A state previously captured from this terminal.
startRow int
The first row of the rendered region.
height int
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)

Parameters

left int
The zero-based column.
top int
The zero-based row.