386BSD 0.1 development
[unix-history] / usr / src / usr.bin / telnet / telnet.1
CommitLineData
7b089094
WJ
1.\" Copyright (c) 1983, 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)telnet.1 6.16 (Berkeley) 7/27/91
33.\"
34.Dd July 27, 1991
35.Dt TELNET 1
36.Os BSD 4.2
37.Sh NAME
38.Nm telnet
39.Nd User interface to the
40.Tn TELNET
41protocol
42.Sh SYNOPSIS
43.Nm telnet
44.Op Fl d
45.Op Fl a
46.Op Fl n Ar tracefile
47.Op Fl e Ar escapechar
48.Oo
49.Op Fl l Ar user
50.Ar host
51.Op port
52.Oc
53.Sh DESCRIPTION
54The
55.Nm telnet
56command
57is used to communicate with another host using the
58.Tn TELNET
59protocol.
60If
61.Nm telnet
62is invoked without the
63.Ar host
64argument, it enters command mode,
65indicated by its prompt
66.Pq Nm telnet\&> .
67In this mode, it accepts and executes the commands listed below.
68If it is invoked with arguments, it performs an
69.Ic open
70command with those arguments.
71.Pp
72Options:
73.Bl -tag -width indent
74.It Fl d
75Sets the initial value of the
76.Ic debug
77toggle to
78.Dv TRUE
79.It Fl a
80Attempt automatic login.
81Currently, this sends the user name via the
82.Ev USER
83variable
84of the
85.Ev ENVIRON
86option if supported by the remote system.
87The name used is that of the current user as returned by
88.Xr getlogin 2
89if it agrees with the current user ID,
90otherwise it is the name associated with the user ID.
91.It Fl n Ar tracefile
92Opens
93.Ar tracefile
94for recording trace information.
95See the
96.Ic set tracefile
97command below.
98.It Fl l Ar user
99When connecting to the remote system, if the remote system
100understands the
101.Ev ENVIRON
102option, then
103.Ar user
104will be sent to the remote system as the value for the variable USER.
105This option implies the
106.Fl a
107option.
108This option may also be used with the
109.Ic open
110command.
111.It Fl e Ar escape char
112Sets the initial
113.Nm
114.Nm telnet
115escape character to
116.Ar escape char.
117If
118.Ar escape char
119is ommitted, then
120there will be no escape character.
121.It Ar host
122Indicates the official name, an alias, or the Internet address
123of a remote host.
124.It Ar port
125Indicates a port number (address of an application). If a number is
126not specified, the default
127.Nm telnet
128port is used.
129.El
130.Pp
131Once a connection has been opened,
132.Nm telnet
133will attempt to enable the
134.Dv TELNET LINEMODE
135option.
136If this fails, then
137.Nm telnet
138will revert to one of two input modes:
139either \*(Lqcharacter at a time\*(Rq
140or \*(Lqold line by line\*(Rq
141depending on what the remote system supports.
142.Pp
143When
144.Dv LINEMODE
145is enabled, character processing is done on the
146local system, under the control of the remote system. When input
147editing or character echoing is to be disabled, the remote system
148will relay that information. The remote system will also relay
149changes to any special characters that happen on the remote
150system, so that they can take effect on the local system.
151.Pp
152In \*(Lqcharacter at a time\*(Rq mode, most
153text typed is immediately sent to the remote host for processing.
154.Pp
155In \*(Lqold line by line\*(Rq mode, all text is echoed locally,
156and (normally) only completed lines are sent to the remote host.
157The \*(Lqlocal echo character\*(Rq (initially \*(Lq^E\*(Rq) may be used
158to turn off and on the local echo
159(this would mostly be used to enter passwords
160without the password being echoed).
161.Pp
162If the
163.Dv LINEMODE
164option is enabled, or if the
165.Ic localchars
166toggle is
167.Dv TRUE
168(the default for \*(Lqold line by line\*(Lq; see below),
169the user's
170.Ic quit ,
171.Ic intr ,
172and
173.Ic flush
174characters are trapped locally, and sent as
175.Tn TELNET
176protocol sequences to the remote side.
177If
178.Dv LINEMODE
179has ever been enabled, then the user's
180.Ic susp
181and
182.Ic eof
183are also sent as
184.Tn TELNET
185protocol sequences,
186and
187.Ic quit
188is sent as a
189.Dv TELNET ABORT
190instead of
191.Dv BREAK
192There are options (see
193.Ic toggle
194.Ic autoflush
195and
196.Ic toggle
197.Ic autosynch
198below)
199which cause this action to flush subsequent output to the terminal
200(until the remote host acknowledges the
201.Tn TELNET
202sequence) and flush previous terminal input
203(in the case of
204.Ic quit
205and
206.Ic intr ) .
207.Pp
208While connected to a remote host,
209.Nm telnet
210command mode may be entered by typing the
211.Nm telnet
212\*(Lqescape character\*(Rq (initially \*(Lq^]\*(Rq).
213When in command mode, the normal terminal editing conventions are available.
214.Pp
215The following
216.Nm telnet
217commands are available.
218Only enough of each command to uniquely identify it need be typed
219(this is also true for arguments to the
220.Ic mode ,
221.Ic set ,
222.Ic toggle ,
223.Ic unset ,
224.Ic slc ,
225.Ic environ ,
226and
227.Ic display
228commands).
229.Pp
230.Bl -tag -width "mode type"
231.It Ic close
232Close a
233.Tn TELNET
234session and return to command mode.
235.It Ic display Ar argument ...
236Displays all, or some, of the
237.Ic set
238and
239.Ic toggle
240values (see below).
241.It Ic mode Ar type
242.Ar Type
243is one of several options, depending on the state of the
244.Tn TELNET
245session.
246The remote host is asked for permission to go into the requested mode.
247If the remote host is capable of entering that mode, the requested
248mode will be entered.
249.Bl -tag -width Ar
250.It Ic character
251Disable the
252.Dv TELNET LINEMODE
253option, or, if the remote side does not understand the
254.Dv LINEMODE
255option, then enter \*(Lqcharacter at a time\*(Lq mode.
256.It Ic line
257Enable the
258.Dv TELNET LINEMODE
259option, or, if the remote side does not understand the
260.Dv LINEMODE
261option, then attempt to enter \*(Lqold-line-by-line\*(Lq mode.
262.It Ic isig Pq Ic \-isig
263Attempt to enable (disable) the
264.Dv TRAPSIG
265mode of the
266.Dv LINEMODE
267option.
268This requires that the
269.Dv LINEMODE
270option be enabled.
271.It Ic edit Pq Ic \-edit
272Attempt to enable (disable) the
273.Dv EDIT
274mode of the
275.Dv LINEMODE
276option.
277This requires that the
278.Dv LINEMODE
279option be enabled.
280.It Ic softtabs Pq Ic \-softtabs
281Attempt to enable (disable) the
282.Dv SOFT_TAB
283mode of the
284.Dv LINEMODE
285option.
286This requires that the
287.Dv LINEMODE
288option be enabled.
289.It Ic litecho Pq Ic \-litecho
290Attempt to enable (disable) the
291.Dv LIT_ECHO
292mode of the
293.Dv LINEMODE
294option.
295This requires that the
296.Dv LINEMODE
297option be enabled.
298.It Ic \&?
299Prints out help information for the
300.Ic mode
301command.
302.El
303.It Xo
304.Ic open Ar host
305.Oo Op Fl l
306.Ar user
307.Oc Ns Oo Fl
308.Ar port Oc
309.Xc
310Open a connection to the named host.
311If no port number
312is specified,
313.Nm telnet
314will attempt to contact a
315.Tn TELNET
316server at the default port.
317The host specification may be either a host name (see
318.Xr hosts 5 )
319or an Internet address specified in the \*(Lqdot notation\*(Rq (see
320.Xr inet 3 ) .
321The
322.Op Fl l
323option may be used to specify the user name
324to be passed to the remote system via the
325.Ev ENVIRON
326option.
327When connecting to a non-standard port,
328.Nm telnet
329omits any automatic initiation of
330.Tn TELNET
331options. When the port number is preceeded by a minus sign,
332the inital option negotiation is done.
333After establishing a connection, the file
334.Pa \&.telnetrc
335in the
336users home directory is opened. Lines begining with a # are
337comment lines. Blank lines are ignored. Lines that begin
338without whitespace are the start of a machine entry. The
339first thing on the line is the name of the machine that is
340being connected to. The rest of the line, and successive
341lines that begin with whitespace are assumed to be
342.Nm telnet
343commands and are processed as if they had been typed
344in manually to the
345.Nm telnet
346command prompt.
347.It Ic quit
348Close any open
349.Tn TELNET
350session and exit
351.Nm telnet .
352An end of file (in command mode) will also close a session and exit.
353.It Ic send Ar arguments
354Sends one or more special character sequences to the remote host.
355The following are the arguments which may be specified
356(more than one argument may be specified at a time):
357.Pp
358.Bl -tag -width escape
359.It Ic abort
360Sends the
361.Dv TELNET ABORT
362(Abort
363processes)
364sequence.
365.It Ic ao
366Sends the
367.Dv TELNET AO
368(Abort Output) sequence, which should cause the remote system to flush
369all output
370.Em from
371the remote system
372.Em to
373the user's terminal.
374.It Ic ayt
375Sends the
376.Dv TELNET AYT
377(Are You There)
378sequence, to which the remote system may or may not choose to respond.
379.It Ic brk
380Sends the
381.Dv TELNET BRK
382(Break) sequence, which may have significance to the remote
383system.
384.It Ic ec
385Sends the
386.Dv TELNET EC
387(Erase Character)
388sequence, which should cause the remote system to erase the last character
389entered.
390.It Ic el
391Sends the
392.Dv TELNET EL
393(Erase Line)
394sequence, which should cause the remote system to erase the line currently
395being entered.
396.It Ic eof
397Sends the
398.Dv TELNET EOF
399(End Of File)
400sequence.
401.It Ic eor
402Sends the
403.Dv TELNET EOR
404(End of Record)
405sequence.
406.It Ic escape
407Sends the current
408.Nm telnet
409escape character (initially \*(Lq^\*(Rq).
410.It Ic ga
411Sends the
412.Dv TELNET GA
413(Go Ahead)
414sequence, which likely has no significance to the remote system.
415.It Ic getstatus
416If the remote side supports the
417.Dv TELNET STATUS
418command,
419.Ic getstatus
420will send the subnegotiation to request that the server send
421its current option status.
422.It Ic ip
423Sends the
424.Dv TELNET IP
425(Interrupt Process) sequence, which should cause the remote
426system to abort the currently running process.
427.It Ic nop
428Sends the
429.Dv TELNET NOP
430(No OPeration)
431sequence.
432.It Ic susp
433Sends the
434.Dv TELNET SUSP
435(SUSPend process)
436sequence.
437.It Ic synch
438Sends the
439.Dv TELNET SYNCH
440sequence.
441This sequence causes the remote system to discard all previously typed
442(but not yet read) input.
443This sequence is sent as
444.Tn TCP
445urgent
446data (and may not work if the remote system is a
447.Bx 4.2
448system -- if
449it doesn't work, a lower case \*(Lqr\*(Rq may be echoed on the terminal).
450.It Ic \&?
451Prints out help information for the
452.Ic send
453command.
454.El
455.It Ic set Ar argument value
456.It Ic unset Ar argument value
457The
458.Ic set
459command will set any one of a number of
460.Nm telnet
461variables to a specific value or to
462.Dv TRUE .
463The special value
464.Ic off
465turns off the function associated with
466the variable, this is equivalent to using the
467.Ic unset
468command.
469The
470.Ic unset
471command will disable or set to
472.Dv FALSE
473any of the specified functions.
474The values of variables may be interrogated with the
475.Ic display
476command.
477The variables which may be set or unset, but not toggled, are
478listed here. In addition, any of the variables for the
479.Ic toggle
480command may be explicitly set or unset using
481the
482.Ic set
483and
484.Ic unset
485commands.
486.Bl -tag -width escape
487.It Ic echo
488This is the value (initially \*(Lq^E\*(Rq) which, when in
489\*(Lqline by line\*(Rq mode, toggles between doing local echoing
490of entered characters (for normal processing), and suppressing
491echoing of entered characters (for entering, say, a password).
492.It Ic eof
493If
494.Nm telnet
495is operating in
496.Dv LINEMODE
497or \*(Lqold line by line\*(Rq mode, entering this character
498as the first character on a line will cause this character to be
499sent to the remote system.
500The initial value of the eof character is taken to be the terminal's
501.Ic eof
502character.
503.It Ic erase
504If
505.Nm telnet
506is in
507.Ic localchars
508mode (see
509.Ic toggle
510.Ic localchars
511below),
512.Sy and
513if
514.Nm telnet
515is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
516character is typed, a
517.Dv TELNET EC
518sequence (see
519.Ic send
520.Ic ec
521above)
522is sent to the remote system.
523The initial value for the erase character is taken to be
524the terminal's
525.Ic erase
526character.
527.It Ic escape
528This is the
529.Nm telnet
530escape character (initially \*(Lq^[\*(Rq) which causes entry
531into
532.Nm telnet
533command mode (when connected to a remote system).
534.It Ic flushoutput
535If
536.Nm telnet
537is in
538.Ic localchars
539mode (see
540.Ic toggle
541.Ic localchars
542below)
543and the
544.Ic flushoutput
545character is typed, a
546.Dv TELNET AO
547sequence (see
548.Ic send
549.Ic ao
550above)
551is sent to the remote host.
552The initial value for the flush character is taken to be
553the terminal's
554.Ic flush
555character.
556.It Ic interrupt
557If
558.Nm telnet
559is in
560.Ic localchars
561mode (see
562.Ic toggle
563.Ic localchars
564below)
565and the
566.Ic interrupt
567character is typed, a
568.Dv TELNET IP
569sequence (see
570.Ic send
571.Ic ip
572above)
573is sent to the remote host.
574The initial value for the interrupt character is taken to be
575the terminal's
576.Ic intr
577character.
578.It Ic kill
579If
580.Nm telnet
581is in
582.Ic localchars
583mode (see
584.Ic toggle
585.Ic localchars
586below),
587.Ic and
588if
589.Nm telnet
590is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
591character is typed, a
592.Dv TELNET EL
593sequence (see
594.Ic send
595.Ic el
596above)
597is sent to the remote system.
598The initial value for the kill character is taken to be
599the terminal's
600.Ic kill
601character.
602.It Ic lnext
603If
604.Nm telnet
605is operating in
606.Dv LINEMODE
607or \*(Lqold line by line\*(Lq mode, then this character is taken to
608be the terminal's
609.Ic lnext
610character.
611The initial value for the lnext character is taken to be
612the terminal's
613.Ic lnext
614character.
615.It Ic quit
616If
617.Nm telnet
618is in
619.Ic localchars
620mode (see
621.Ic toggle
622.Ic localchars
623below)
624and the
625.Ic quit
626character is typed, a
627.Dv TELNET BRK
628sequence (see
629.Ic send
630.Ic brk
631above)
632is sent to the remote host.
633The initial value for the quit character is taken to be
634the terminal's
635.Ic quit
636character.
637.It Ic reprint
638If
639.Nm telnet
640is operating in
641.Dv LINEMODE
642or \*(Lqold line by line\*(Lq mode, then this character is taken to
643be the terminal's
644.Ic reprint
645character.
646The initial value for the reprint character is taken to be
647the terminal's
648.Ic reprint
649character.
650.It Ic start
651If the
652.Dv TELNET TOGGLE-FLOW-CONTROL
653option has been enabled,
654then this character is taken to
655be the terminal's
656.Ic start
657character.
658The initial value for the kill character is taken to be
659the terminal's
660.Ic start
661character.
662.It Ic stop
663If the
664.Dv TELNET TOGGLE-FLOW-CONTROL
665option has been enabled,
666then this character is taken to
667be the terminal's
668.Ic stop
669character.
670The initial value for the kill character is taken to be
671the terminal's
672.Ic stop
673character.
674.It Ic susp
675If
676.Nm telnet
677is in
678.Ic localchars
679mode, or
680.Dv LINEMODE
681is enabled, and the
682.Ic suspend
683character is typed, a
684.Dv TELNET SUSP
685sequence (see
686.Ic send
687.Ic susp
688above)
689is sent to the remote host.
690The initial value for the suspend character is taken to be
691the terminal's
692.Ic suspend
693character.
694.It Ic tracefile
695Thi is the file to which the output, caused by
696.Ic netdata
697or
698.Ic option
699tracing being
700.Dv TRUE ,
701will be written. If it is set to
702.Dq Fl ,
703then tracing information will be written to standard output (the default).
704.It Ic worderase
705If
706.Nm telnet
707is operating in
708.Dv LINEMODE
709or \*(Lqold line by line\*(Lq mode, then this character is taken to
710be the terminal's
711.Ic worderase
712character.
713The initial value for the worderase character is taken to be
714the terminal's
715.Ic worderase
716character.
717.It Ic \&?
718Displays the legal
719.Ic set
720.Pq Ic unset
721commands.
722.El
723.It Ic slc Ar state
724The
725.Ic slc
726command (Set Local Characters) is used to set
727or change the state of the the special
728characters when the
729.Dv TELNET LINEMODE
730option has
731been enabled. Special characters are characters that get
732mapped to
733.Tn TELNET
734commands sequences (like
735.Ic ip
736or
737.Ic quit )
738or line editing characters (like
739.Ic erase
740and
741.Ic kill ) .
742By default, the local special characters are exported.
743.Bl -tag -width Fl
744.It Ic export
745Switch to the local defaults for the special characters. The
746local default characters are those of the local terminal at
747the time when
748.Nm telnet
749was started.
750.It Ic import
751Switch to the remote defaults for the special characters.
752The remote default characters are those of the remote system
753at the time when the
754.Tn TELNET
755connection was established.
756.It Ic check
757Verify the current settings for the current special characters.
758The remote side is requested to send all the current special
759character settings, and if there are any discrepencies with
760the local side, the local side will switch to the remote value.
761.It Ic \&?
762Prints out help information for the
763.Ic slc
764command.
765.El
766.It Ic environ Ar arguments...
767The
768.Ic environ
769command is used to manipulate the
770the variables that my be sent through the
771.Dv TELNET ENVIRON
772option.
773The initial set of variables is taken from the users
774environment, with only the
775.Ev DISPLAY
776and
777.Ev PRINTER
778variables being exported by default.
779The
780.Ev USER
781variable is also exported if the
782.Fl a
783or
784.Fl l
785options are used.
786.br
787Valid arguments for the
788.Ic environ
789command are:
790.Bl -tag -width Fl
791.It Ic define Ar variable value
792Define the variable
793.Ar variable
794to have a value of
795.Ar value.
796Any variables defined by this command are automatically exported.
797The
798.Ar value
799may be enclosed in single or double quotes so
800that tabs and spaces may be included.
801.It Ic undefine Ar variable
802Remove
803.Ar variable
804from the list of environment variables.
805.It Ic export Ar variable
806Mark the variable
807.Ar variable
808to be exported to the remote side.
809.It Ic unexport Ar variable
810Mark the variable
811.Ar variable
812to not be exported unless
813explicitly asked for by the remote side.
814.It Ic list
815List the current set of environment variables.
816Those marked with a
817.Cm *
818will be sent automatically,
819other variables will only be sent if explicitly requested.
820.It Ic \&?
821Prints out help information for the
822.Ic environ
823command.
824.El
825.It Ic toggle Ar arguments ...
826Toggle (between
827.Dv TRUE
828and
829.Dv FALSE )
830various flags that control how
831.Nm telnet
832responds to events.
833These flags may be set explicitly to
834.Dv TRUE
835or
836.Dv FALSE
837using the
838.Ic set
839and
840.Ic unset
841commands listed above.
842More than one argument may be specified.
843The state of these flags may be interrogated with the
844.Ic display
845command.
846Valid arguments are:
847.Bl -tag -width Ar
848.It Ic autoflush
849If
850.Ic autoflush
851and
852.Ic localchars
853are both
854.Dv TRUE ,
855then when the
856.Ic ao ,
857or
858.Ic quit
859characters are recognized (and transformed into
860.Tn TELNET
861sequences; see
862.Ic set
863above for details),
864.Nm telnet
865refuses to display any data on the user's terminal
866until the remote system acknowledges (via a
867.Dv TELNET TIMING MARK
868option)
869that it has processed those
870.Tn TELNET
871sequences.
872The initial value for this toggle is
873.Dv TRUE
874if the terminal user had not
875done an "stty noflsh", otherwise
876.Dv FALSE
877(see
878.Xr stty 1 ) .
879.It Ic autosynch
880If
881.Ic autosynch
882and
883.Ic localchars
884are both
885.Dv TRUE ,
886then when either the
887.Ic intr
888or
889.Ic quit
890characters is typed (see
891.Ic set
892above for descriptions of the
893.Ic intr
894and
895.Ic quit
896characters), the resulting
897.Tn TELNET
898sequence sent is followed by the
899.Dv TELNET SYNCH
900sequence.
901This procedure
902.Ic should
903cause the remote system to begin throwing away all previously
904typed input until both of the
905.Tn TELNET
906sequences have been read and acted upon.
907The initial value of this toggle is
908.Dv FALSE .
909.It Ic binary
910Enable or disable the
911.Dv TELNET BINARY
912option on both input and output.
913.It Ic inbinary
914Enable or disable the
915.Dv TELNET BINARY
916option on input.
917.It Ic outbinary
918Enable or disable the
919.Dv TELNET BINARY
920option on output.
921.It Ic crlf
922If this is
923.Dv TRUE ,
924then carriage returns will be sent as
925.Li <CR><LF> .
926If this is
927.Dv FALSE ,
928then carriage returns will be send as
929.Li <CR><NUL> .
930The initial value for this toggle is
931.Dv FALSE .
932.It Ic crmod
933Toggle carriage return mode.
934When this mode is enabled, most carriage return characters received from
935the remote host will be mapped into a carriage return followed by
936a line feed.
937This mode does not affect those characters typed by the user, only
938those received from the remote host.
939This mode is not very useful unless the remote host
940only sends carriage return, but never line feed.
941The initial value for this toggle is
942.Dv FALSE .
943.It Ic debug
944Toggles socket level debugging (useful only to the
945.Ic super user ) .
946The initial value for this toggle is
947.Dv FALSE .
948.It Ic localchars
949If this is
950.Dv TRUE ,
951then the
952.Ic flush ,
953.Ic interrupt ,
954.Ic quit ,
955.Ic erase ,
956and
957.Ic kill
958characters (see
959.Ic set
960above) are recognized locally, and transformed into (hopefully) appropriate
961.Tn TELNET
962control sequences
963(respectively
964.Ic ao ,
965.Ic ip ,
966.Ic brk ,
967.Ic ec ,
968and
969.Ic el ;
970see
971.Ic send
972above).
973The initial value for this toggle is
974.Dv TRUE
975in \*(Lqold line by line\*(Rq mode,
976and
977.Dv FALSE
978in \*(Lqcharacter at a time\*(Rq mode.
979When the
980.Dv LINEMODE
981option is enabled, the value of
982.Ic localchars
983is ignored, and assumed to always be
984.Dv TRUE .
985If
986.Dv LINEMODE
987has ever been enabled, then
988.Ic quit
989is sent as
990.Ic abort ,
991and
992.Ic eof and
993.B suspend
994are sent as
995.Ic eof and
996.Ic susp ,
997see
998.Ic send
999above).
1000.It Ic netdata
1001Toggles the display of all network data (in hexadecimal format).
1002The initial value for this toggle is
1003.Dv FALSE .
1004.It Ic options
1005Toggles the display of some internal
1006.Nm telnet
1007protocol processing (having to do with
1008.Tn TELNET
1009options).
1010The initial value for this toggle is
1011.Dv FALSE .
1012.It Ic prettydump
1013When the
1014.Ic netdata
1015toggle is enabled, if
1016.Ic prettydump
1017is enabled the output from the
1018.Ic netdata
1019command will be formated in a more user readable format.
1020Spaces are put between each character in the output, and the
1021begining of any
1022.Tn TELNET
1023escape sequence is preceeded by a '*' to aid in locating them.
1024.It Ic \&?
1025Displays the legal
1026.Ic toggle
1027commands.
1028.El
1029.It Ic z
1030Suspend
1031.Nm telnet .
1032This command only works when the user is using the
1033.Xr csh 1 .
1034.It Ic \&! Op Ar command
1035Execute a single command in a subshell on the local
1036system. If
1037.Ic command
1038is ommitted, then an interactive
1039subshell is invoked.
1040.It Ic status
1041Show the current status of
1042.Nm telnet .
1043This includes the peer one is connected to, as well
1044as the current mode.
1045.It Ic \&? Op Ar command
1046Get help. With no arguments,
1047.Nm telnet
1048prints a help summary.
1049If a command is specified,
1050.Nm telnet
1051will print the help information for just that command.
1052.El
1053.Sh ENVIRONMENT
1054.Nm Telnet
1055uses at least the
1056.Ev HOME ,
1057.Ev SHELL ,
1058.Ev DISPLAY ,
1059and
1060.Ev TERM
1061environent variables.
1062Other envirnoment variables may be propogated
1063to the other side via the
1064.Dv TELNET ENVIRON
1065option.
1066.Sh FILES
1067.Bl -tag -width ~/.telnetrc -compact
1068.It Pa ~/.telnetrc
1069user customized telnet startup values
1070.El
1071.Sh HISTORY
1072The
1073.Nm Telnet
1074command appeared in
1075.Bx 4.2 .
1076.Sh NOTES
1077.Pp
1078On some remote systems, echo has to be turned off manually when in
1079\*(Lqold line by line\*(Rq mode.
1080.Pp
1081In \*(Lqold line by line\*(Rq mode or
1082.Dv LINEMODE
1083the terminal's
1084.Ic eof
1085character is only recognized (and sent to the remote system)
1086when it is the first character on a line.