RFC 1073: Telnet Window Size Option

2026-08-25

RFC: RFC 1073

Published: 1988

Authors: David Waitzman

Every time you drag the corner of your terminal window and watch vim instantly reflow, you are relying on a mechanism first specified in October 1988 in a four-page RFC by David Waitzman. It is called NAWS — Negotiate About Window Size — and it is one of the quietest, most-used pieces of protocol machinery on your machine.

The problem. The original Telnet protocol assumed a Network Virtual Terminal that was, essentially, a teletype: an infinitely long roll of paper 80 characters wide. Once glass TTYs and windowed workstations arrived, this stopped working. Programs like vi, emacs, more, and curses-based full-screen apps needed to know two numbers — rows and columns — before they could paint the screen. On a local terminal, an ioctl(TIOCGWINSZ) answered that question. Across a Telnet session, there was no answer at all. Servers defaulted to 24×80 and pretended.

The design. Waitzman slotted a new option into Telnet's existing negotiation framework. Both sides exchange the standard IAC WILL NAWS / IAC DO NAWS handshake (option code 31). Once agreed, the client immediately sends a subnegotiation containing four bytes: width (16 bits, big-endian) and height (16 bits, big-endian), wrapped in IAC SB NAWS … IAC SE. Any subsequent resize triggers another subnegotiation. That is the whole protocol.

Two design choices are worth calling out. First, the width and height are 16 bits — extravagant in 1988, but it means the protocol has never needed a revision for HiDPI or ultra-wide displays. Second, because the reserved byte 0xFF (IAC) can appear inside a legitimate dimension (e.g. a 255-column window), Waitzman explicitly requires it to be doubled inside the payload — the same escape convention Telnet uses everywhere else. It is a tiny detail that a lot of hand-rolled implementations still get wrong.

Why it still matters. Telnet is effectively dead as a remote-shell protocol, but NAWS is not. When SSH was designed, the connection protocol (later RFC 4254) copied the pattern almost verbatim: a pty-req request carries the initial dimensions, and a window-change channel request carries updates — the same four 32-bit values (upgraded from 16 bits), sent on every SIGWINCH. That chain runs through everything modern: tmux resizing its panes, docker exec -it, kubectl exec, VS Code's remote terminal, GitHub Codespaces, Mosh. All of them are, at some layer, propagating a NAWS-shaped message.

A footnote of history. David Waitzman is better known for a different RFC he wrote three years later: RFC 1149, A Standard for the Transmission of IP Datagrams on Avian Carriers — the famous April Fools' spec for IP over homing pigeons. It is a nice reminder that the same engineer who wrote the joke about carrier pigeons also wrote one of the most invisibly-load-bearing extensions in the Unix world. Look at your terminal's title bar the next time you resize it: those four bytes crossing the wire are RFC 1073, still doing its job 38 years later.

Why it matters: NAWS is the reason every SSH session, container shell, and terminal multiplexer knows how big your window is — a 1988 Telnet extension that quietly became universal infrastructure.

All newsletters