Motivation
With increasing Telnet usage, it has become apparent that the ability to do command line processing on the local machine and send completed lines to the remote machine is a feature necessary in several environments. First, in the case of a connection over long delay equipment, it is very frustrating to the user to have the echoing of his data take several seconds. Second, some supercomputers, due to their nature, are not good at handling and processing single character input. For these machines, it is better to have the front end computer do the character processing, and leave the supercomputer's cycles available for doing vectorized number crunching.
There have been attempts to make local line editing work within the existing Telnet specs. Indeed, the 4.3 BSD tape includes a version of Telnet that attempts to do this through recognition of the state of the ECHO and SUPRESS-GO-AHEAD options; other implementations do this recognition purely through the ECHO option.
There are problems with both of these methods. Using just the ECHO provides no mechanism to have ECHO to the user turned off, and leave local character processing on, for example, when a user is typing a password.
The usage of the SUPRESS-GO-AHEAD comes from reading into RFC 858, where it states:
"In many TELNET implementations it will be desirable to couple the SUPRESS-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 it commonly understood to be character at a time echoing by the remote computer."
The reverse reading of this is that without the ECHO option or the SUPPRESS-GO-AHEAD option, you are in line at a time mode, implying local line editing. This has the obvious problem that that is not what the SUPPRESS-GO-AHEAD option is supposed to mean.
Other shortcomings are that the Telnet specification is not rich enough to handle all of the special characters that some of the current operating systems support. For example, the ECHO/SGA implementation supports two ways of interrupting a process, by borrowing the BRK option for the second interrupt. Some implementations have taken the EOR option to send an End-Of-File. Obviously, this is using things for which they were not intended, and the correct solution would be to define new options.
Another problem is that some implementations of line mode buffer up the input until the end of the line, and then send the whole line across, editing characters and all. No local editing of the line has been done.
After examining several implementations, it has become clear that the correct thing to do is to implement new options to enhance the current Telnet specification so that it can support local line editing in a reasonable, reliable, and consistent manner.
There are three states that are of interest.
-
Local line editing and local signal trapping
-
Remote line editing, local signal trapping
-
Remote line editing, remote signal trapping
The case of local line editing and remote signal trapping is not a very interesting case, because you don't recognize the signals, and cannot send them to the remote side for it to recognize until the line has been completed. Also, special signals usually will have an effect on the line editing function, and if they are not being trapped locally the desired action will not happen.
Local line editing means that all normal command line character processing, like "Erase Character" and "Erase Line", happen on the local system, and only when "CR LF" (or some other special character) is encountered is the edited data sent to the remote system.
Signal trapping means, for example, that if the user types the character associated with the IP function, then the "IAC IP" function is sent to the remote side instead of the character typed. Remote signal trapping means, for example, that if the user types the character associated with the IP function, then the "IAC IP" function is not sent to the remote side, but rather the actual character typed is sent to the remote side.