RFC 1073
Telnet window size option
Telnet Window Size Option π
- RFC: 1073 πΈ
- Author: D. Waitzman, BBN STC
- Date: October 1988
- Working group: Network Working Group
- Status: a proposed Telnet option
- Obsoletes / Updates: the header doesn't list anything it obsoletes or updates β¨
Status of This Memo β¨
okay so this RFC describes a proposed Telnet option that lets a client tell a Telnet server how big its window is π¦ distribution of this memo is unlimited, so share the tea π
1. Command Name and Option Code π
the option is called NAWS (Negotiate About Window Size) and its code is 31 π§
Name = NAWS (Negotiate About Window Size)
Code = 31
2. Command Meanings π
here's the whole negotiation vocab, bestie π¬ each one shows who sends it and what it means:
IAC WILL NAWS
the client sends this to suggest that NAWS gets used πΈ
IAC WON'T NAWS
the client sends this to refuse to use NAWS π
IAC DO NAWS
the server sends this to suggest that NAWS gets used π
IAC DON'T NAWS
the server sends this to refuse to use NAWS π
IAC SB NAWS <16-bit value> <16-bit value> IAC SE
the client sends this to tell the server the window width and height β¨
the window size info goes from the client to the server through this option, and it's advisory π¦ the server can accept the option and still ignore the info it gets, which is giving chill vibes π
the client and server negotiate sending the window size info with the normal WILL/DO/DON'T/WON'T mechanism π«Ά if they agree, the client can then send a subnegotiation to convey the window size. if the client's window size changes later (like when the user resizes it), the client can send the subnegotiation again π some operating systems the server might run on don't let the window size info get updated, so the server can send a DON'T NAWS to forbid more subnegotiation after it was first accepted π₯ following these rules, a negotiation loop will not form π
the subnegotiation has two values: the width and height of the window in characters π each value is sent as two bytes, in the Internet standard byte and bit order. that means the biggest possible width or height is 65535 characters β¨ a value of zero is acceptable for the width (or height), and it means no width (or height) is being sent. in that case, the server assumes an operating-system-specific width (or height), which will probably be based on the terminal type info that might have come through the TERMINAL TYPE Telnet option π
the syntax for the subnegotiation is:
IAC SB NAWS WIDTH[1] WIDTH[0] HEIGHT[1] HEIGHT[0] IAC SE
as the Telnet protocol requires, any occurrence of 255 in the subnegotiation must be doubled so it doesn't get mixed up with the IAC character (which has a value of 255) π
3. Default Specification π§
WON'T NAWS
DON'T NAWS
this option doesn't assume any default window size info π· the terminal type (passed with the TERMINAL TYPE Telnet option) can often hint at a window size, but this option doesn't need that hint π§
4. Motivation β¨
with windowing systems getting more and more popular, a Telnet client is often run inside a window that can change size πͺ and the Telnet server needs to know that size for proper cursor control π the window can also get resized in the middle of a Telnet session, and the new size has to get to the server too. this memo specifies an option for sending 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) don't have the right semantics for this, and they aren't in common use [see RFC-1011 "Official Internet Protocols", and the "Defense Protocol Handbook"] π the NAOL and NAOP options go both ways (so the server might control the client's line width or page size), and they're limited to 253 characters in each axis π
this option is a better model of the normal window negotiation process π the client has total control over the size of its window and just tells the server what the current size is. the 253 character height and width limit is also too low, so this new option has a limit of 65535 characters π finally, this option sends the window height and width together, because they usually change at the same time, and lots of operating systems and windowing apps like to think about height and width changing simultaneously π
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, the Telnet client has to be told about it. on 4.3 BSD Unix, the Telnet process might catch the SIGWINCH (window changed) signal and send a new NAWS subnegotiation to the server π₯ when the server gets a NAWS subnegotiation, it might do the appropriate ioctl to handle the new info, and then it could send a SIGWINCH to its child, which is probably a shell πβ¨
6. Examples π§
in the examples below, all the numbers in the data stream are in decimal π
1. Server suggests and client agrees to use NAWS π
(server sends) IAC DO NAWS
(client sends) IAC WILL NAWS
(client sends) IAC SB NAWS 0 80 0 24 IAC SE
[A window 80 characters wide, 24 characters high]
[some time occurs and the user changes the window size]
(client sends) IAC SB NAWS 0 80 0 64 IAC SE
[A window 80 characters wide, 64 characters high]
in all numeric form:
(server sends) 255 253 31
(client sends) 255 251 31
(client sends) 255 250 31 0 80 0 24 255 240
(client sends) 255 250 31 0 80 0 64 255 240
2. Client suggests and server agrees to use NAWS π¦
(client sends) IAC WILL NAWS
(server sends) IAC DO NAWS
(client sends) IAC SB NAWS 1 44 0 24 IAC SE
[A window 300 characters wide, 24 characters high]
3. Client suggests and server refuses to use NAWS π
(client sends) IAC WILL NAWS
(server sends) IAC DON'T NAWS
4. Server suggests and client refuses to use NAWS π
(server sends) IAC DO NAWS
(client sends) IAC WON'T NAWS
7. Acknowledgments π«Ά
a more detailed, X window system specific version of this option was built at Carnegie-Mellon University by Glenn Marcy and the author π it's widely used in the Carnegie-Mellon University Computer Science Department π Mr. Marcy helped write an early draft of this memo that documented that more detailed option π
π¦ where this page comes from
- ietf: rfc1073 1988-10
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms