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 (or old) line-by-line mode" into "character-at-a-time" mode, as described in RFC 858. Some MUD clients and servers will also use the IAC GA byte sequence 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.
Section 6 of RFC 858 provides this explanation:
In many TELNET implementations it will be desirable to couple the
SUPPRESS-GO-AHEAD option to the echo option so that when the echo
option is in effect, the SUPPRESS-GO-AHEAD option is in effect
simultaneously: both of these options will normally have to be in
effect simultaneously to effect what is commonly understood to be
character at a time echoing by the remote computer.
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) as 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 IAC GA bytes 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. ("Modern" in this context means "post 1978"!) The SGA option MUST be enabled in order to tell a client to disable its local line entry mode and to enter Character-at-a-time visual mode.
To enable Character-at-a-time mode, the client and server must agree
that the server will handle the character echo function, and that the
server will not try to run the half-duplex GA protocol for the client.
During Telnet negotiation, a game server that wishes to advertise the
availability of character-at-a-time mode should send:
Server Sends:
WILL SUPPRESS GO AHEAD
WILL ECHO
A client that supports character-at-a-time mode and wants to enable it should respond to the server with:
Client Sends:
DO SUPPRESS GO AHEAD
DO ECHO
Once ECHO and SGA protocols are enabled, the client may send individual bytes (keystrokes) up to the server for processing, without having to terminate the bytes with the CRLF line termination sequence, and the client MUST NOT echo the keystrokes locally.
A MUD server that wishes to operate in obsolete line mode doesn't need
to negotiate anything at all to the client, because obsolete line mode is the Telnet
default mode. However, if the server wishes to blank a password it should send:
Server Sends:
WILL ECHO
A client should respond with:
Client Sends:
DO ECHO
To get out of 'hidden password entry mode', the server should send:
Server Sends:
WONT ECHO
A client should respond with:
Client Sends:
DONT ECHO
Echo mode processing is not a bi-directional protocol, as it is not reasonable for the client to echo data sent from the server back to the server. The client should NOT initiate the ECHO protocol, it should only respond to WILL/WONT offered from the server.
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 |
---|---|---|
Disabled (default) | Disabled (default) |
Obsolete line-by-line mode - This is the most common mode used by
MU* servers and dedicated line mode MU* clients.
This is the default mode for Telnet if neither the ECHO or SGA 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, backspaces, deletes, or terminal escapes. The server does NOT echo that submitted data back to the client for display. |
Enabled | Enabled |
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, backspaces, deletes, tabs, function keys, and other escape sequences. The data send by the client does NOT have to be CRLF terminated. |
Enabled | Disabled (default) |
Line mode Hidden password entry - Usually a transient
state that tells the line mode client not to echo while password is
being entered.
While it may seem counter-intuitive at first, the way most MUD games hide a password as it is being entered is to ENABLE echo on the server. When the server offers to enable echo with a "WILL ECHO", it is telling the client that the server will be responsible for echoing any required text, and that the client should NOT echo typed text in its local line editor. So, to hide the password as it is being entered, 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, typically with a "WONT ECHO", so that the line mode client goes back to showing the user what they type. |
Disabled (default) | Enabled |
Obsolete line-by-line mode, explicit SGA - Less common mode used by MUD servers and Line mode clients
Functionally equivalent to the default line mode, but with suppression of the obsolete half-duplex Go-Ahead protocol explicitly enabled. 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. |
New servers and client SHOULD try and negotiate Standard character-at-at-time-mode, and implement a basic CLI with backspace and delete support, and control key filtering, as this allows the most server and client flexibility.
There is nothing about being in character-at-a-time mode that prevents a MUD client from simultaneously 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.
MUD clients that provide a local line editor SHOULD try and respect a game server's ECHO setting, and mask keystrokes from the user in the local line editor 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.