Skip to content

NawsWindowSizeProvider

IWindowSizeProvider that adapts Telnet NAWS (RFC 1073) subnegotiation events from TelnetFraming into the pluggable interface. The TCS is initialized eagerly so that NAWS arriving before GetSizeAsync(CancellationToken) is called (e.g. during framing negotiation) is not lost.

public sealed class NawsWindowSizeProvider : IWindowSizeProvider

Creates a new NAWS window size provider backed by the specified Telnet framing layer.

public NawsWindowSizeProvider(TelnetFraming framing)

Detects the current window size. Returns null if the size cannot be determined.

public ValueTask<(int Width, int Height)?> GetSizeAsync(CancellationToken ct)

ValueTask<(int Width, int Height)?>

Raised when the terminal window is resized.

public event EventHandler<WindowSizeEventArgs>? SizeChanged

EventHandler<WindowSizeEventArgs>