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