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