Skip to content

VtKeyReader

An IReplKeyReader that reads from a TextReader and parses VT/ANSI escape sequences into ConsoleKeyInfo values. Used for server-side line editing over remote transports (WebSocket, SignalR, etc.).

public sealed class VtKeyReader : IReplKeyReader

Initializes a new instance of the VtKeyReader class.

public VtKeyReader(TextReader reader)

Reads the next key press. Blocks until a key is available or token is cancelled.

public ValueTask<ConsoleKeyInfo> ReadKeyAsync(CancellationToken ct)

ValueTask<ConsoleKeyInfo> - The key info of the pressed key.

Returns true if a key is available to read without blocking.

public bool KeyAvailable { get; }

bool

Optional callback invoked when a DTTERM window size report is received. Parameters are (cols, rows).

public Action<int, int>? OnResize { get; set; }

Action<int, int>