Telnet X display location option
Extracted elements (12)
The option exists so that remote hosts can determine the X display of a connecting Telnet client, enabling remote X applications to use the same display without requiring out-of-band communication. The design is modelled on RFC 1079 (Telnet Terminal Speed Option).
When the X display location contains no hostname (e.g., ':0' or 'unix:0.0'), the Telnet client must substitute the actual client hostname before transmitting the value to the remote Telnet, since the remote host cannot resolve a bare display reference.
IAC DO X-DISPLAY-LOCATION signals the sender is willing to receive the X display location; IAC DON'T refuses to accept it.
IAC WILL X-DISPLAY-LOCATION signals the sender is willing to send the X display location in a subsequent sub-negotiation; IAC WON'T refuses.
Only the sender of DO may issue SEND requests (IAC SB X-DISPLAY-LOCATION SEND IAC SE), and only the sender of WILL may transmit the actual X display location in an IS sub-command.
The X display location may not be sent spontaneously; it may only be transmitted in response to an explicit SEND request.
The Telnet X Display Location option is assigned the name X-DISPLAY-LOCATION (XDISPLOC) and option code 35.
The X display location value is an NVT ASCII string following the Unix DISPLAY environment variable convention: <host>:<dispnum>[.<screennum>]. No extraneous characters such as spaces may be included.
WILL and DO commands are used only to obtain and grant permission for future discussion; the actual exchange of display location data occurs within IAC SB sub-commands.
Default state is WON'T X-DISPLAY-LOCATION / DON'T X-DISPLAY-LOCATION, meaning no display location will be exchanged unless both sides negotiate WILL and DO.
The IS sub-command is encoded as IAC SB X-DISPLAY-LOCATION IS <NVT-ASCII-string> IAC SE, where IS has code 0. The example 'SRI-NIC.ARPA:0.0' yields a 22-octet command.
The SEND sub-command is encoded as IAC SB X-DISPLAY-LOCATION SEND IAC SE, where SEND has code 1. It requests the receiver to transmit its X display location.