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.
- Kind:
Class - Namespace: Repl.Telnet
- Assembly:
Repl.Telnet - Source: src/Repl.Telnet/NawsWindowSizeProvider.cs
Signature
Section titled “Signature”public sealed class NawsWindowSizeProvider : IWindowSizeProviderInheritance
Section titled “Inheritance”Implements
Section titled “Implements”Constructors
Section titled “Constructors”NawsWindowSizeProvider(TelnetFraming)
Section titled “NawsWindowSizeProvider(TelnetFraming)”Creates a new NAWS window size provider backed by the specified Telnet framing layer.
public NawsWindowSizeProvider(TelnetFraming framing)Parameters
Section titled “Parameters”framing(TelnetFraming)
Methods
Section titled “Methods”GetSizeAsync(CancellationToken)
Section titled “GetSizeAsync(CancellationToken)”Detects the current window size. Returns null if the size cannot be determined.
public ValueTask<(int Width, int Height)?> GetSizeAsync(CancellationToken ct)Parameters
Section titled “Parameters”ct(CancellationToken)
Returns
Section titled “Returns”ValueTask<(int Width, int Height)?>
Events
Section titled “Events”SizeChanged
Section titled “SizeChanged”Raised when the terminal window is resized.
public event EventHandler<WindowSizeEventArgs>? SizeChangedReturns
Section titled “Returns”EventHandler<WindowSizeEventArgs>