Network Working Group D. Waitzman
Request For Comments: 1073 BBN STC
October 1988
Telnet Window Size Option
1. Command Name and Option Code
Name = NAWS (Negotiate About Window Size)
2. Command Meanings
IAC WILL NAWS
Waitzman [Page 1]
RFC 1073 Telnet Window Size Option October 1988
The subnegotiation consists of two values, the width and the height of the window in characters. The values are each sent as two bytes, in the Internet standard byte and bit order. This allows a maximum window width or height of 65535 characters. A value equal to zero is acceptable for the width (or height), and means that no character width (or height) is being sent. In this case, the width (or height) that will be assumed by the Telnet server is operating system specific (it will probably be based upon the terminal type information that may have been sent using the TERMINAL TYPE Telnet option).
3. Default Specification
WON'T NAWS
4. Motivation
With the increasing popularity of windowing systems, a Telnet client is often run inside a variable-sized window, and the Telnet server needs to know the window size for proper cursor control. The window may also have its size changed during the Telnet session and the updated window size needs to be conveyed to the server. This memo specifies an option to send the window height and width in characters from a client to a server. The Telnet options Negotiate Output Line Width (NAOL) and Negotiate Output Page Size (NAOP) do not have the correct semantics for this purpose, and they are not in common use [see RFC-1011 "Official Internet Protocols", and the "Defense Protocol Handbook"]. The NAOL and NAOP options are bidirectional (i.e., the server might control the client's line width or page size), and are limited to 253 characters in each axis.
Waitzman [Page 2]
RFC 1073 Telnet Window Size Option October 1988
This option is a better model of the normal window negotiation process. The client has total control over the size of its window and simply tells the server what the current window size is. Furthermore, the 253 character height and width limitation is too low so the new option has a limit of 65535 characters. Finally, this option sends the window height and width concurrently because they are typically changed simultaneously and many operating systems and windowing applications prefer to think in terms of simultaneous changes in height and width.
5. Description and Implementation Notes
A typical user of this option might be a Telnet client running under X. After a user resizes the client's window, this must be communicated to the Telnet client. In 4.3 BSD Unix, the signal SIGWINCH (window changed) might be caught by the Telnet process and a new NAWS subnegotiation sent to the server. Upon receipt of a NAWS subnegotiation, the server might do the appropriate ioctl to handle the new information, and then could send a SIGWINCH to its child, probably a shell.
6. Examples
In the following examples all numbers in the data stream are in decimal.
Waitzman [Page 3]
RFC 1073 Telnet Window Size Option October 1988
In all numeric form:
7. Acknowledgments
A more elaborate, X window system specific, version of this option has been implemented at Carnegie-Mellon University by Glenn Marcy and the author. It is widely used in the Carnegie-Mellon University Computer Science Department. Mr. Marcy helped write an early draft of this memo documenting the more elaborate option.