Skip to content

ITerminalInfo

Exposes terminal capabilities for custom IReplInteractionHandler implementations. Register or resolve via DI to adapt prompts to the current terminal environment.

public interface ITerminalInfo

Gets a value indicating whether the process can read individual key presses (i.e. stdin is not redirected and no hosted session is active).

bool CanReadKeys { get; }

bool

Gets a value indicating whether the terminal supports ANSI escape sequences, including those that drive it: cursor movement, screen clearing. It is false on redirected output even when colour was forced (FORCE_COLOR, CLICOLOR_FORCE); Palette answers for colour.

bool IsAnsiSupported { get; }

bool

Gets the active ANSI color palette, or null when colour is disabled.

AnsiPalette? Palette { get; }

AnsiPalette

Gets the current terminal window size, or null when unavailable.

(int Width, int Height)? WindowSize { get; }

(int Width, int Height)?