Skip to content

IReplKeyReader

Injectable service for handlers that need raw key input (watch/top pattern). When a handler declares this parameter, it owns the console input and decides what each key means. Custom IReplPagerRenderer implementations can also use this service through ReplPagerRenderContext to drive interactive navigation without depending directly on Console.

public interface IReplKeyReader

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

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.

bool KeyAvailable { get; }

bool