rfc-1073

Telnet window size option

D. Waitzman
date1988-10 streamLegacy statusPROPOSED STANDARD pages4 canonicalhttps://www.rfc-editor.org/rfc/rfc1073 doi10.17487/RFC1073
This RFC describes a proposed Telnet option to allow a client to convey window size to a Telnet server.

Extracted elements (14)

design-rationale §4

The 16-bit encoding was chosen to raise the per-axis limit from 253 characters (NAOL/NAOP) to 65535, accommodating large windows in modern windowing systems such as X.

design-rationale §4

The existing NAOL and NAOP options were rejected because they are bidirectional (the server could control the client's dimensions) and are limited to 253 characters per axis. NAWS is client-driven and supports up to 65535 characters per axis.

design-rationale §4

Width and height are sent together in a single subnegotiation because window resizes typically change both dimensions simultaneously and most operating systems and windowing applications model resizes as simultaneous two-dimensional changes.

interoperability-note §5

A server receiving NAWS subnegotiations may perform an ioctl to apply the new window dimensions and signal its child process (e.g., via SIGWINCH on 4.3 BSD Unix). Because not all OS environments support this, server behavior on receipt of NAWS data is implementation-specific.

interoperability-note §2

The window size information conveyed by NAWS is advisory. A server may accept the option yet choose not to use the received width and height values.

normative-requirement §2 MAY

After client and server agree via WILL/DO, the client may send an IAC SB NAWS subnegotiation to convey window size. The client may resend the subnegotiation whenever the window size changes.

normative-requirement §2 MUST

Any occurrence of the value 255 (IAC) within the NAWS subnegotiation data must be doubled to distinguish it from the IAC command character.

normative-requirement §2 MAY

If the server's operating system does not support window size updates, the server may send DON'T NAWS after initially accepting the option to forbid further subnegotiations. This rule prevents negotiation loops.

normative-requirement §3 MUST NOT

The default state for both client and server is WON'T NAWS / DON'T NAWS. No default window size information is assumed by this option.

protocol-element §2

A width or height value of zero in the subnegotiation means no character dimension is being conveyed. In that case, the server falls back to an OS-specific default, typically derived from the TERMINAL TYPE option.

protocol-element §1

The NAWS (Negotiate About Window Size) option is assigned option code 31. It allows a Telnet client to convey the current terminal window width and height in characters to the Telnet server.

security-consideration §2

The mandatory doubling of IAC (0xFF) bytes within the subnegotiation payload is the sole in-band integrity mechanism; failure to double would allow window-size data containing 0xFF to be misinterpreted as a Telnet command, corrupting the command stream.

security

state-machine §2

NAWS negotiation follows the standard Telnet WILL/DO/WON'T/DON'T four-way handshake. Either side may initiate; if both agree, the client sends the subnegotiation. The server may subsequently send DON'T NAWS to terminate further subnegotiations.

wire-format §2

The NAWS subnegotiation encoding is: IAC SB NAWS WIDTH[1] WIDTH[0] HEIGHT[1] HEIGHT[0] IAC SE. Width and height are each 16-bit unsigned integers in network byte order (big-endian), allowing values from 0 to 65535.