home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 1000s / rfc1073.txt < prev    next >
Text File  |  1988-10-05  |  7KB  |  227 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                        D. Waitzman
  8. Request For Comments: 1073                                       BBN STC
  9.                                                             October 1988
  10.  
  11.                        Telnet Window Size Option
  12.  
  13. Status of this Memo
  14.  
  15.    This RFC describes a proposed Telnet option to allow a client to
  16.    convey window size to a Telnet server.  Distribution of this memo is
  17.    unlimited.
  18.  
  19. 1. Command Name and Option Code
  20.  
  21.       Name = NAWS (Negotiate About Window Size)
  22.  
  23.       Code = 31
  24.  
  25. 2. Command Meanings
  26.  
  27.       IAC WILL NAWS
  28.  
  29.          Sent by the Telnet client to suggest that NAWS be used.
  30.  
  31.       IAC WON'T NAWS
  32.  
  33.          Sent by the Telnet client to refuse to use NAWS.
  34.  
  35.       IAC DO NAWS
  36.  
  37.          Sent by the Telnet server to suggest that NAWS be used.
  38.  
  39.       IAC DON'T NAWS
  40.  
  41.          Sent by the Telnet server to refuse to use NAWS.
  42.  
  43.       IAC SB NAWS <16-bit value> <16-bit value> IAC SE
  44.  
  45.          Sent by the Telnet client to inform the Telnet server of the
  46.          window width and height.
  47.  
  48.    The window size information is conveyed via this option from the
  49.    Telnet client to the Telnet server.  The information is advisory.
  50.    The server may accept the option, but not use the information that is
  51.    sent.
  52.  
  53.    The client and server negotiate sending the window size information
  54.    using the standard Telnet WILL/DO/DON'T/WON'T mechanism.  If the
  55.  
  56.  
  57.  
  58. Waitzman                                                        [Page 1]
  59.  
  60. RFC 1073               Telnet Window Size Option            October 1988
  61.  
  62.  
  63.    client and server agree, the client may then send a subnegotiation to
  64.    convey the window size.  If the client's window size is later changed
  65.    (for instance, the window size is altered by the user), the client
  66.    may again send the subnegotiation.  Because certain operating
  67.    systems, on which a server may be executing, may not allow the window
  68.    size information to be updated, the server may send a DON'T NAWS to
  69.    the client to forbid further subnegotiation after it was initially
  70.    accepted.  A negotiation loop will not form following these rules.
  71.  
  72.    The subnegotiation consists of two values, the width and the height
  73.    of the window in characters.  The values are each sent as two bytes,
  74.    in the Internet standard byte and bit order.  This allows a maximum
  75.    window width or height of 65535 characters.  A value equal to zero is
  76.    acceptable for the width (or height), and means that no character
  77.    width (or height) is being sent.  In this case, the width (or height)
  78.    that will be assumed by the Telnet server is operating system
  79.    specific (it will probably be based upon the terminal type
  80.    information that may have been sent using the TERMINAL TYPE Telnet
  81.    option).
  82.  
  83.    The syntax for the subnegotiation is:
  84.  
  85.       IAC SB NAWS WIDTH[1] WIDTH[0] HEIGHT[1] HEIGHT[0] IAC SE
  86.  
  87.    As required by the Telnet protocol, any occurrence of 255 in the
  88.    subnegotiation must be doubled to distinguish it from the IAC
  89.    character (which has a value of 255).
  90.  
  91. 3. Default Specification
  92.  
  93.       WON'T NAWS
  94.  
  95.       DON'T NAWS
  96.  
  97.    This option does not assume any default window size information.
  98.    Often the terminal type, passed with the TERMINAL TYPE Telnet option,
  99.    may imply a window size, but that is not necessary for this option.
  100.  
  101. 4. Motivation
  102.  
  103.    With the increasing popularity of windowing systems, a Telnet client
  104.    is often run inside a variable-sized window, and the Telnet server
  105.    needs to know the window size for proper cursor control.  The window
  106.    may also have its size changed during the Telnet session and the
  107.    updated window size needs to be conveyed to the server.  This memo
  108.    specifies an option to send the window height and width in characters
  109.    from a client to a server.
  110.  
  111.  
  112.  
  113.  
  114. Waitzman                                                        [Page 2]
  115.  
  116. RFC 1073               Telnet Window Size Option            October 1988
  117.  
  118.  
  119.    The Telnet options Negotiate Output Line Width (NAOL) and Negotiate
  120.    Output Page Size (NAOP) do not have the correct semantics for this
  121.    purpose, and they are not in common use [see RFC-1011 "Official
  122.    Internet Protocols", and the "Defense Protocol Handbook"].  The NAOL
  123.    and NAOP options are bidirectional (i.e., the server might control
  124.    the client's line width or page size), and are limited to 253
  125.    characters in each axis.
  126.  
  127.    This option is a better model of the normal window negotiation
  128.    process.  The client has total control over the size of its window
  129.    and simply tells the server what the current window size is.
  130.    Furthermore, the 253 character height and width limitation is too low
  131.    so the new option has a limit of 65535 characters.  Finally, this
  132.    option sends the window height and width concurrently because they
  133.    are typically changed simultaneously and many operating systems and
  134.    windowing applications prefer to think in terms of simultaneous
  135.    changes in height and width.
  136.  
  137. 5. Description and Implementation Notes
  138.  
  139.    A typical user of this option might be a Telnet client running under
  140.    X.  After a user resizes the client's window, this must be
  141.    communicated to the Telnet client.  In 4.3 BSD Unix, the signal
  142.    SIGWINCH (window changed) might be caught by the Telnet process and a
  143.    new NAWS subnegotiation sent to the server.  Upon receipt of a NAWS
  144.    subnegotiation, the server might do the appropriate ioctl to handle
  145.    the new information, and then could send a SIGWINCH to its child,
  146.    probably a shell.
  147.  
  148. 6. Examples
  149.  
  150.    In the following examples all numbers in the data stream are in
  151.    decimal.
  152.  
  153.       1. Server suggest and client agrees to use NAWS.
  154.  
  155.          (server sends)  IAC DO NAWS
  156.          (client sends)  IAC WILL NAWS
  157.          (client sends)  IAC SB NAWS 0 80 0 24 IAC SE
  158.  
  159.             [A window 80 characters wide, 24 characters high]
  160.             [some time occurs and the user changes the window size]
  161.  
  162.          (client sends)  IAC SB NAWS 0 80 0 64 IAC SE
  163.  
  164.             [A window 80 characters wide, 64 characters high]
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Waitzman                                                        [Page 3]
  171.  
  172. RFC 1073               Telnet Window Size Option            October 1988
  173.  
  174.  
  175.       In all numeric form:
  176.  
  177.          (server sends)  255 253 31
  178.          (client sends)  255 251 31
  179.          (client sends)  255 250 31 0 80 0 24 255 240
  180.  
  181.          (client sends)  255 250 31 0 80 0 64 255 240
  182.  
  183.        2.  Client suggests and server agrees to used NAWS.
  184.  
  185.          (client sends)  IAC WILL NAWS
  186.          (server sends)  IAC DO NAWS
  187.          (client sends)  IAC SB NAWS 1 44 0 24 IAC SE
  188.  
  189.             [A window 300 characters wide, 24 characters high]
  190.  
  191.        3.  Client suggest and server refuses to use NAWS.
  192.  
  193.          (client sends)  IAC WILL NAWS
  194.          (server sends)  IAC DON'T NAWS
  195.  
  196.        4.  Server suggests and client refuses to use NAWS.
  197.  
  198.          (server sends)  IAC DO NAWS
  199.          (client sends)  IAC WON'T NAWS
  200.  
  201. 7. Acknowledgments
  202.  
  203.    A more elaborate, X window system specific, version of this option
  204.    has been implemented at Carnegie-Mellon University by Glenn Marcy and
  205.    the author.  It is widely used in the Carnegie-Mellon University
  206.    Computer Science Department.  Mr. Marcy helped write an early draft
  207.    of this memo documenting the more elaborate option.
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226. Waitzman                                                        [Page 4]
  227.