ECHO and SGA Telnet Options for MUDs

Documentation

The Telnet ECHO and SGA protocols are used to hide password data as it is being typed, and it is also how standard telnet and mud clients negotiate out of the default "obsolete line-by-line mode" into "character-at-a-time" mode. See section 6 of RFC 858 for details. Some MUD clients will use the GA option to determine when it is OK to parse prompt data sent from a game. See RFC 854 page 5, and CIE 3.2.2 for details.

Explanation

The ECHO and SGA protocols work together to control the Telnet session. The documentation can be confusing because of its age, and because the original GA protocol (that SGA explicitly disables) was found to be ineffective early in its adoption.

Note that SGA ("Suppress Go-Ahead") does NOT mean "never send the GA byte." It is instead used to explicitly disable the original default half-duplex signaling protocol (the Go-Ahead Protocol) described in the early Telnet RFC's, a protocol that, while the still the default for Telnet today, was abandoned early-on.

By long-standing practice, no Telnet client or Telnet server in use (circa 2024) performs the half duplex GA signaling protocol as described in the early RFCs, whether SGA is negotiated or not. A MUD client/server pair may therefore send the GA signal as an "end of prompt" character without risk of confusion, regardless of the SGA setting.

While the Go-Ahead Protocol is long gone, enabling the SGA Telnet option is still used as the signal that a Telnet client is "modern" enough to handle a full-duplex, full-screen, Visual Terminal session- as opposed to being a line mode teletype paper printer that is incapable of handling most VT terminal escapes. The SGA option MUST be negotiated to DO in order to tell a client to disable its local line entry mode and to enter Character-at-a-time visual mode.

Summary

The effects of negotiating ECHO and SGA as they relate to current (circa 2024) MUD protocols are summarized in the table below.

ECHO SGA Result
DO DO Standard character-at-a-time mode. - This is the most common mode used by non-MUD telnet servers and clients.
Client is expected (but not required) to send data immediately to the Server, as the user types it. Server chooses how and when to echo the data back to the Client. The half duplex GA protocol is not attempted. The client may send ANSI/VT100 control characters and escape sequences, like for function keys. A server may request a MUD client operating in obsolete line-by-line to enter this mode (DO ECHO) in order to blank the password entry.
DO DONT (default) Hidden password entry - Tells the client not to echo while password is being entered.
While it may seem counter-intuitive at first, the way to hide a password as it is being entered is to ENABLE echo on the server. When the server negotiates DO ECHO, it is telling the client that the server will be responsible for echoing any required text, and that the client should stop echoing text in its local line editor. To hide the password, the server takes responsibility for echoing text, and then simply doesn't echo the password back to the user. Many (but not all) line-by-line mode MUD clients will respect the ECHO setting and hide the data being typed in the local line editor, on the assumption that it is a password. Once the password is entered, the server should negotiate back into the previous ECHO mode.
DONT (default) DO Obsolete line-by-line mode, explicit SGA - Less common mode used by MUD servers and Line mode clients
Similar to the default line mode below, but with the obsolete half-duplex Go-Ahead protocol explicitly disabled. The client is expected to echo keystrokes into a local line editor as they are entered. Only complete, terminated lines are sent to the server.
DONT (default) DONT (default) Obsolete line-by-line mode - The most common mode used by MU* servers and dedicated MU* clients.
This is the default mode for Telnet if neither option is negotiated or supported. In this mode, the client is expected to provide some kind of line entry with local editing capability. The client is expected to send completed, newline terminated lines of data to the server, without containing control characters or terminal escapes. The server does NOT echo that submitted data back to the client for display.

Best Practice for New MUD Clients and Servers

New servers and client SHOULD try and negotiate Standard character-at-at-time-mode, as this allows the most server and client flexibility.

There is nothing about character-at-a-time mode that prevents a MUD client from providing a local line-by-line mode editor, and sending pre-edited lines up to the server. (See LociTerm, for an example). This allows for local text entry on platforms such as mobile where a local editor is a natural way to enter text, while still allowing a client to send individual keystrokes, such as function keys, in an immediate and natural way via on-screen buttons without the need to implement a separate out of band protocol.

Concerns about latency and per-keystroke packet transfer times are no longer an issue in the video-rich, high speed internet of (circa 2024), and character-at-a-time mode can provide the best of line mode editing with immediate, server-side keystroke processing.

For Servers that operate in Obsolete line-by-line mode (DONT SGA) MUD clients that provide a local line editor SHOULD try and respect the ECHO setting, and mask keystrokes from the user when the server has requested responsibility for ECHOing.

MUD servers SHOULD always try to negotiate SGA, and MUD clients SHOULD always accept negotiation of SGA.

MUD servers and clients MAY continue to use the GA byte as a prompt marker (regardless of SGA negotiation), but SHOULD consider using the EOR Telnet option instead, since it is use is more standardized across existing clients and servers.

PLAY NOW