xref: /freebsd/bin/stty/stty.1 (revision 128f63cedc14ae21b35f74e11e2fe1a5659c58e8)
19ddb49cbSWarner Losh.\"-
24b88c807SRodney W. Grimes.\" Copyright (c) 1990, 1993, 1994
34b88c807SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
44b88c807SRodney W. Grimes.\"
54b88c807SRodney W. Grimes.\" This code is derived from software contributed to Berkeley by
64b88c807SRodney W. Grimes.\" the Institute of Electrical and Electronics Engineers, Inc.
74b88c807SRodney W. Grimes.\"
84b88c807SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
94b88c807SRodney W. Grimes.\" modification, are permitted provided that the following conditions
104b88c807SRodney W. Grimes.\" are met:
114b88c807SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
124b88c807SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
134b88c807SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
144b88c807SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
154b88c807SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
16fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors
174b88c807SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
184b88c807SRodney W. Grimes.\"    without specific prior written permission.
194b88c807SRodney W. Grimes.\"
204b88c807SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
214b88c807SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
224b88c807SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
234b88c807SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
244b88c807SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
254b88c807SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
264b88c807SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
274b88c807SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
284b88c807SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
294b88c807SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
304b88c807SRodney W. Grimes.\" SUCH DAMAGE.
314b88c807SRodney W. Grimes.\"
324b88c807SRodney W. Grimes.\"     @(#)stty.1	8.4 (Berkeley) 4/18/94
334b88c807SRodney W. Grimes.\"
34a7eac018SKonstantin Belousov.Dd September 27, 2022
354b88c807SRodney W. Grimes.Dt STTY 1
364b88c807SRodney W. Grimes.Os
374b88c807SRodney W. Grimes.Sh NAME
384b88c807SRodney W. Grimes.Nm stty
394b88c807SRodney W. Grimes.Nd set the options for a terminal device interface
404b88c807SRodney W. Grimes.Sh SYNOPSIS
41be8b1497SRuslan Ermilov.Nm
42a89237aeSRuslan Ermilov.Op Fl a | e | g
434b88c807SRodney W. Grimes.Op Fl f Ar file
44a89237aeSRuslan Ermilov.Op Ar arguments
454b88c807SRodney W. Grimes.Sh DESCRIPTION
464b88c807SRodney W. GrimesThe
479ba8bd65SPhilippe Charnier.Nm
484b88c807SRodney W. Grimesutility sets or reports on terminal
494b88c807SRodney W. Grimescharacteristics for the device that is its standard input.
50a89237aeSRuslan ErmilovIf no options or arguments are specified, it reports the settings of a subset
514b88c807SRodney W. Grimesof characteristics as well as additional ones if they differ from their
524b88c807SRodney W. Grimesdefault values.
534b88c807SRodney W. GrimesOtherwise it modifies
544b88c807SRodney W. Grimesthe terminal state according to the specified arguments.
554b88c807SRodney W. GrimesSome combinations of arguments are mutually
564b88c807SRodney W. Grimesexclusive on some terminal types.
574b88c807SRodney W. Grimes.Pp
584b88c807SRodney W. GrimesThe following options are available:
599ba8bd65SPhilippe Charnier.Bl -tag -width indent
604b88c807SRodney W. Grimes.It Fl a
614b88c807SRodney W. GrimesDisplay all the current settings for the terminal to standard output
624b88c807SRodney W. Grimesas per
634b88c807SRodney W. Grimes.St -p1003.2 .
644b88c807SRodney W. Grimes.It Fl e
654b88c807SRodney W. GrimesDisplay all the current settings for the terminal to standard output
664b88c807SRodney W. Grimesin the traditional
67753d686dSRuslan Ermilov.Bx
684b88c807SRodney W. Grimes``all'' and ``everything'' formats.
694b88c807SRodney W. Grimes.It Fl f
704b88c807SRodney W. GrimesOpen and use the terminal named by
714b88c807SRodney W. Grimes.Ar file
72eccea571SRuslan Ermilovrather than using standard input.
73eccea571SRuslan ErmilovThe file is opened
744b88c807SRodney W. Grimesusing the
754b88c807SRodney W. Grimes.Dv O_NONBLOCK
764b88c807SRodney W. Grimesflag of
774b88c807SRodney W. Grimes.Fn open ,
784b88c807SRodney W. Grimesmaking it possible to
794b88c807SRodney W. Grimesset or display settings on a terminal that might otherwise
804b88c807SRodney W. Grimesblock on the open.
814b88c807SRodney W. Grimes.It Fl g
824b88c807SRodney W. GrimesDisplay all the current settings for the terminal to standard output
834b88c807SRodney W. Grimesin a form that may be used as an argument to a subsequent invocation of
849ba8bd65SPhilippe Charnier.Nm
854b88c807SRodney W. Grimesto restore the current terminal state as per
864b88c807SRodney W. Grimes.St -p1003.2 .
874b88c807SRodney W. Grimes.El
884b88c807SRodney W. Grimes.Pp
894b88c807SRodney W. GrimesThe following arguments are available to set the terminal
904b88c807SRodney W. Grimescharacteristics:
914b88c807SRodney W. Grimes.Ss Control Modes:
924b88c807SRodney W. GrimesControl mode flags affect hardware characteristics associated with the
93eccea571SRuslan Ermilovterminal.
94eccea571SRuslan ErmilovThis corresponds to the c_cflag in the termios structure.
954b88c807SRodney W. Grimes.Bl -tag -width Fl
964b88c807SRodney W. Grimes.It Cm parenb Pq Fl parenb
974b88c807SRodney W. GrimesEnable (disable) parity generation
984b88c807SRodney W. Grimesand detection.
994b88c807SRodney W. Grimes.It Cm parodd Pq Fl parodd
1004b88c807SRodney W. GrimesSelect odd (even) parity.
1014b88c807SRodney W. Grimes.It Cm cs5 cs6 cs7 cs8
1024b88c807SRodney W. GrimesSelect character size, if possible.
1034b88c807SRodney W. Grimes.It Ar number
1044b88c807SRodney W. GrimesSet terminal baud rate to the
1054b88c807SRodney W. Grimesnumber given, if possible.
1064b88c807SRodney W. GrimesIf the
1074b88c807SRodney W. Grimesbaud rate is set to zero, modem
1084b88c807SRodney W. Grimescontrol is no longer
1094b88c807SRodney W. Grimesasserted.
1104b88c807SRodney W. Grimes.It Cm ispeed Ar number
1114b88c807SRodney W. GrimesSet terminal input baud rate to the
1124b88c807SRodney W. Grimesnumber given, if possible.
1134b88c807SRodney W. GrimesIf the
1144b88c807SRodney W. Grimesinput baud rate is set to zero, the
1154b88c807SRodney W. Grimesinput baud rate is set to the
1164b88c807SRodney W. Grimesvalue of the output baud
1174b88c807SRodney W. Grimesrate.
1184b88c807SRodney W. Grimes.It Cm ospeed Ar number
1194b88c807SRodney W. GrimesSet terminal output baud rate to
1204b88c807SRodney W. Grimesthe number given, if possible.
1214b88c807SRodney W. GrimesIf
1224b88c807SRodney W. Grimesthe output baud rate is set to
1234b88c807SRodney W. Grimeszero, modem control is
1244b88c807SRodney W. Grimesno longer asserted.
1254b88c807SRodney W. Grimes.It Cm speed Ar number
1264b88c807SRodney W. GrimesThis sets both
1274b88c807SRodney W. Grimes.Cm ispeed
1284b88c807SRodney W. Grimesand
1294b88c807SRodney W. Grimes.Cm ospeed
1304b88c807SRodney W. Grimesto
1314b88c807SRodney W. Grimes.Ar number .
1324b88c807SRodney W. Grimes.It Cm hupcl Pq Fl hupcl
1334b88c807SRodney W. GrimesStop asserting modem control
1344b88c807SRodney W. Grimes(do not stop asserting modem control) on last close.
1354b88c807SRodney W. Grimes.It Cm hup Pq Fl hup
1364b88c807SRodney W. GrimesSame as hupcl
1374b88c807SRodney W. Grimes.Pq Fl hupcl .
1384b88c807SRodney W. Grimes.It Cm cstopb Pq Fl cstopb
1394b88c807SRodney W. GrimesUse two (one) stop bits per character.
1404b88c807SRodney W. Grimes.It Cm cread Pq Fl cread
1414b88c807SRodney W. GrimesEnable (disable) the receiver.
1424b88c807SRodney W. Grimes.It Cm clocal Pq Fl clocal
1434b88c807SRodney W. GrimesAssume a line without (with) modem
1444b88c807SRodney W. Grimescontrol.
1454b88c807SRodney W. Grimes.It Cm crtscts Pq Fl crtscts
146d693a28eSJoseph KoshyEnable (disable) RTS/CTS flow control.
147f5dcfbe3SWarner Losh.It Cm rtsdtr Pq Fl rtsdtr
148705aad98SStephen HurdEnable (disable) asserting RTS/DTR on open.
1494b88c807SRodney W. Grimes.El
1504b88c807SRodney W. Grimes.Ss Input Modes:
1514b88c807SRodney W. GrimesThis corresponds to the c_iflag in the termios structure.
1524b88c807SRodney W. Grimes.Bl -tag -width Fl
1534b88c807SRodney W. Grimes.It Cm ignbrk Pq Fl ignbrk
1544b88c807SRodney W. GrimesIgnore (do not ignore) break on
1554b88c807SRodney W. Grimesinput.
1564b88c807SRodney W. Grimes.It Cm brkint Pq Fl brkint
1574b88c807SRodney W. GrimesSignal (do not signal)
1584b88c807SRodney W. Grimes.Dv INTR
1594b88c807SRodney W. Grimeson
1604b88c807SRodney W. Grimesbreak.
1614b88c807SRodney W. Grimes.It Cm ignpar Pq Fl ignpar
1620fe788e3SBruce EvansIgnore (do not ignore) characters with parity
1634b88c807SRodney W. Grimeserrors.
1644b88c807SRodney W. Grimes.It Cm parmrk Pq Fl parmrk
1650fe788e3SBruce EvansMark (do not mark) characters with parity errors.
1664b88c807SRodney W. Grimes.It Cm inpck Pq Fl inpck
1674b88c807SRodney W. GrimesEnable (disable) input parity
1684b88c807SRodney W. Grimeschecking.
1694b88c807SRodney W. Grimes.It Cm istrip Pq Fl istrip
1704b88c807SRodney W. GrimesStrip (do not strip) input characters
1714b88c807SRodney W. Grimesto seven bits.
1724b88c807SRodney W. Grimes.It Cm inlcr Pq Fl inlcr
1734b88c807SRodney W. GrimesMap (do not map)
1744b88c807SRodney W. Grimes.Dv NL
1754b88c807SRodney W. Grimesto
1764b88c807SRodney W. Grimes.Dv CR
1774b88c807SRodney W. Grimeson input.
1784b88c807SRodney W. Grimes.It Cm igncr Pq Fl igncr
1794b88c807SRodney W. GrimesIgnore (do not ignore)
1804b88c807SRodney W. Grimes.Dv CR
1814b88c807SRodney W. Grimeson input.
1824b88c807SRodney W. Grimes.It Cm icrnl Pq Fl icrnl
1834b88c807SRodney W. GrimesMap (do not map)
1844b88c807SRodney W. Grimes.Dv CR
1854b88c807SRodney W. Grimesto
1864b88c807SRodney W. Grimes.Dv NL
1874b88c807SRodney W. Grimeson input.
1884b88c807SRodney W. Grimes.It Cm ixon Pq Fl ixon
1894b88c807SRodney W. GrimesEnable (disable)
1904b88c807SRodney W. Grimes.Dv START/STOP
1914b88c807SRodney W. Grimesoutput
1924b88c807SRodney W. Grimescontrol.
1934b88c807SRodney W. GrimesOutput from the system is
1944b88c807SRodney W. Grimesstopped when the system receives
1954b88c807SRodney W. Grimes.Dv STOP
1964b88c807SRodney W. Grimesand started when the system
1974b88c807SRodney W. Grimesreceives
1984b88c807SRodney W. Grimes.Dv START ,
1994b88c807SRodney W. Grimesor if
2004b88c807SRodney W. Grimes.Cm ixany
2014b88c807SRodney W. Grimesis set, any character restarts output.
2024b88c807SRodney W. Grimes.It Cm ixoff Pq Fl ixoff
2034b88c807SRodney W. GrimesRequest that the system send (not
2044b88c807SRodney W. Grimessend)
2054b88c807SRodney W. Grimes.Dv START/STOP
2064b88c807SRodney W. Grimescharacters when
2074b88c807SRodney W. Grimesthe input queue is nearly
2084b88c807SRodney W. Grimesempty/full.
2094b88c807SRodney W. Grimes.It Cm ixany Pq Fl ixany
2104b88c807SRodney W. GrimesAllow any character (allow only
2114b88c807SRodney W. Grimes.Dv START )
2124b88c807SRodney W. Grimesto restart output.
2134b88c807SRodney W. Grimes.It Cm imaxbel Pq Fl imaxbel
2144b88c807SRodney W. GrimesThe system imposes a limit of
2154b88c807SRodney W. Grimes.Dv MAX_INPUT
216eccea571SRuslan Ermilov(currently 255) characters in the input queue.
217eccea571SRuslan ErmilovIf
2184b88c807SRodney W. Grimes.Cm imaxbel
2194b88c807SRodney W. Grimesis set and the input queue limit has been reached,
2204b88c807SRodney W. Grimessubsequent input causes the system to send an ASCII BEL
221eccea571SRuslan Ermilovcharacter to the output queue (the terminal beeps at you).
222eccea571SRuslan ErmilovOtherwise,
2234b88c807SRodney W. Grimesif
2244b88c807SRodney W. Grimes.Cm imaxbel
2254b88c807SRodney W. Grimesis unset and the input queue is full, the next input character causes
2264b88c807SRodney W. Grimesthe entire input and output queues to be discarded.
227*128f63ceSBojan Novković.It Cm iutf8 Pq Fl iutf8
228*128f63ceSBojan NovkovićAssume that input characters are UTF-8 encoded. Setting this flag
229*128f63ceSBojan Novkovićcauses backspace to properly delete multibyte characters in canonical mode.
2304b88c807SRodney W. Grimes.El
2314b88c807SRodney W. Grimes.Ss Output Modes:
2324b88c807SRodney W. GrimesThis corresponds to the c_oflag of the termios structure.
2334b88c807SRodney W. Grimes.Bl -tag -width Fl
2344b88c807SRodney W. Grimes.It Cm opost Pq Fl opost
2354b88c807SRodney W. GrimesPost-process output (do not
2364b88c807SRodney W. Grimespost-process output; ignore all other
2374b88c807SRodney W. Grimesoutput modes).
2384b88c807SRodney W. Grimes.It Cm onlcr Pq Fl onlcr
2394b88c807SRodney W. GrimesMap (do not map)
2404b88c807SRodney W. Grimes.Dv NL
2414b88c807SRodney W. Grimesto
242bbb209f1SBruce Evans.Dv CR-NL
2434b88c807SRodney W. Grimeson output.
2443617ddfcSAssar Westerlund.It Cm ocrnl Pq Fl ocrnl
2453617ddfcSAssar WesterlundMap (do not map)
2463617ddfcSAssar Westerlund.Dv CR
2473617ddfcSAssar Westerlundto
2483617ddfcSAssar Westerlund.Dv NL
2493617ddfcSAssar Westerlundon output.
250f8f8c9f0SEd Schouten.It Cm tab0 tab3
251f8f8c9f0SEd SchoutenSelect tab expansion policy.
252f8f8c9f0SEd Schouten.Cm tab0
253f8f8c9f0SEd Schoutendisables tab expansion, while
254f8f8c9f0SEd Schouten.Cm tab3
255f8f8c9f0SEd Schoutenenables it.
2563617ddfcSAssar Westerlund.It Cm onocr Pq Fl onocr
2573617ddfcSAssar WesterlundDo not (do) output CRs at column zero.
2583617ddfcSAssar Westerlund.It Cm onlret Pq Fl onlret
2593617ddfcSAssar WesterlundOn the terminal NL performs (does not perform) the CR function.
2604b88c807SRodney W. Grimes.El
2614b88c807SRodney W. Grimes.Ss Local Modes:
2624b88c807SRodney W. GrimesLocal mode flags (lflags) affect various and sundry characteristics of terminal
2634b88c807SRodney W. Grimesprocessing.
2644b88c807SRodney W. GrimesHistorically the term "local" pertained to new job control features
2654b88c807SRodney W. Grimesimplemented by Jim Kulp on a
2664b88c807SRodney W. Grimes.Tn Pdp 11/70
2674b88c807SRodney W. Grimesat
2684b88c807SRodney W. Grimes.Tn IIASA .
2694b88c807SRodney W. GrimesLater the driver ran on the first
2704b88c807SRodney W. Grimes.Tn VAX
2714b88c807SRodney W. Grimesat Evans Hall, UC Berkeley, where the job control details
2724b88c807SRodney W. Grimeswere greatly modified but the structure definitions and names
2734b88c807SRodney W. Grimesremained essentially unchanged.
2744b88c807SRodney W. GrimesThe second interpretation of the 'l' in lflag
2754b88c807SRodney W. Grimesis ``line discipline flag'' which corresponds to the
2764b88c807SRodney W. Grimes.Ar c_lflag
2774b88c807SRodney W. Grimesof the
2784b88c807SRodney W. Grimes.Ar termios
2794b88c807SRodney W. Grimesstructure.
2804b88c807SRodney W. Grimes.Bl -tag -width Fl
2814b88c807SRodney W. Grimes.It Cm isig Pq Fl isig
2824b88c807SRodney W. GrimesEnable (disable) the checking of
2834b88c807SRodney W. Grimescharacters against the special control
2844b88c807SRodney W. Grimescharacters
2854b88c807SRodney W. Grimes.Dv INTR , QUIT ,
2864b88c807SRodney W. Grimesand
2874b88c807SRodney W. Grimes.Dv SUSP .
2884b88c807SRodney W. Grimes.It Cm icanon Pq Fl icanon
2894b88c807SRodney W. GrimesEnable (disable) canonical input
2904b88c807SRodney W. Grimes.Pf ( Dv ERASE
2914b88c807SRodney W. Grimesand
2924b88c807SRodney W. Grimes.Dv KILL
2934b88c807SRodney W. Grimesprocessing).
2944b88c807SRodney W. Grimes.It Cm iexten Pq Fl iexten
2954b88c807SRodney W. GrimesEnable (disable) any implementation
2964b88c807SRodney W. Grimesdefined special control characters
2974b88c807SRodney W. Grimesnot currently controlled by icanon,
2984b88c807SRodney W. Grimesisig, or ixon.
2994b88c807SRodney W. Grimes.It Cm echo Pq Fl echo
3004b88c807SRodney W. GrimesEcho back (do not echo back) every
3014b88c807SRodney W. Grimescharacter typed.
3024b88c807SRodney W. Grimes.It Cm echoe Pq Fl echoe
3034b88c807SRodney W. GrimesThe
3044b88c807SRodney W. Grimes.Dv ERASE
3054b88c807SRodney W. Grimescharacter shall (shall
3064b88c807SRodney W. Grimesnot) visually erase the last character
3074b88c807SRodney W. Grimesin the current line from the
3084b88c807SRodney W. Grimesdisplay, if possible.
3094b88c807SRodney W. Grimes.It Cm echok Pq Fl echok
3104b88c807SRodney W. GrimesEcho (do not echo)
3114b88c807SRodney W. Grimes.Dv NL
3124b88c807SRodney W. Grimesafter
3134b88c807SRodney W. Grimes.Dv KILL
3144b88c807SRodney W. Grimescharacter.
3154b88c807SRodney W. Grimes.It Cm echoke Pq Fl echoke
3164b88c807SRodney W. GrimesThe
3174b88c807SRodney W. Grimes.Dv KILL
3184b88c807SRodney W. Grimescharacter shall (shall
3194b88c807SRodney W. Grimesnot) visually erase the
320063ad33aSPhilippe Charniercurrent line from the
3214b88c807SRodney W. Grimesdisplay, if possible.
3224b88c807SRodney W. Grimes.It Cm echonl Pq Fl echonl
3234b88c807SRodney W. GrimesEcho (do not echo)
3244b88c807SRodney W. Grimes.Dv NL ,
3254b88c807SRodney W. Grimeseven if echo
3264b88c807SRodney W. Grimesis disabled.
3274b88c807SRodney W. Grimes.It Cm echoctl Pq Fl echoctl
3284b88c807SRodney W. GrimesIf
3294b88c807SRodney W. Grimes.Cm echoctl
330eccea571SRuslan Ermilovis set, echo control characters as ^X.
331eccea571SRuslan ErmilovOtherwise control characters
3324b88c807SRodney W. Grimesecho as themselves.
3334b88c807SRodney W. Grimes.It Cm echoprt Pq Fl echoprt
334bef84d6bSSheldon HearnFor printing terminals.
335bef84d6bSSheldon HearnIf set, echo erased characters backwards within ``\\''
336eccea571SRuslan Ermilovand ``/''.
337eccea571SRuslan ErmilovOtherwise, disable this feature.
3384b88c807SRodney W. Grimes.It Cm noflsh Pq Fl noflsh
3394b88c807SRodney W. GrimesDisable (enable) flush after
3404b88c807SRodney W. Grimes.Dv INTR , QUIT , SUSP .
3414b88c807SRodney W. Grimes.It Cm tostop Pq Fl tostop
3424b88c807SRodney W. GrimesSend (do not send)
3434b88c807SRodney W. Grimes.Dv SIGTTOU
344eccea571SRuslan Ermilovfor background output.
345eccea571SRuslan ErmilovThis causes background jobs to stop if they attempt
3464b88c807SRodney W. Grimesterminal output.
3474b88c807SRodney W. Grimes.It Cm altwerase Pq Fl altwerase
3484b88c807SRodney W. GrimesUse (do not use) an alternate word erase algorithm when processing
3494b88c807SRodney W. Grimes.Dv WERASE
3504b88c807SRodney W. Grimescharacters.
3514b88c807SRodney W. GrimesThis alternate algorithm considers sequences of
3524b88c807SRodney W. Grimesalphanumeric/underscores as words.
3534b88c807SRodney W. GrimesIt also skips the first preceding character in its classification
3544b88c807SRodney W. Grimes(as a convenience since the one preceding character could have been
3554b88c807SRodney W. Grimeserased with simply an
3564b88c807SRodney W. Grimes.Dv ERASE
3574b88c807SRodney W. Grimescharacter.)
3584b88c807SRodney W. Grimes.It Cm mdmbuf Pq Fl mdmbuf
359eccea571SRuslan ErmilovIf set, flow control output based on condition of Carrier Detect.
360eccea571SRuslan ErmilovOtherwise
3614b88c807SRodney W. Grimeswrites return an error if Carrier Detect is low (and Carrier is not being
3624b88c807SRodney W. Grimesignored with the
3634b88c807SRodney W. Grimes.Dv CLOCAL
3644b88c807SRodney W. Grimesflag.)
3654b88c807SRodney W. Grimes.It Cm flusho Pq Fl flusho
3664b88c807SRodney W. GrimesIndicates output is (is not) being discarded.
3674b88c807SRodney W. Grimes.It Cm pendin Pq Fl pendin
3684b88c807SRodney W. GrimesIndicates input is (is not) pending after a switch from non-canonical
3694b88c807SRodney W. Grimesto canonical mode and will be re-input when a read becomes pending
3704b88c807SRodney W. Grimesor more input arrives.
3714b88c807SRodney W. Grimes.El
3724b88c807SRodney W. Grimes.Ss Control Characters:
3734b88c807SRodney W. Grimes.Bl -tag -width Fl
3744b88c807SRodney W. Grimes.It Ar control-character Ar string
3754b88c807SRodney W. GrimesSet
3764b88c807SRodney W. Grimes.Ar control-character
3774b88c807SRodney W. Grimesto
3784b88c807SRodney W. Grimes.Ar string .
3794b88c807SRodney W. GrimesIf string is a single character,
3804b88c807SRodney W. Grimesthe control character is set to
3814b88c807SRodney W. Grimesthat character.
3824b88c807SRodney W. GrimesIf string is the
3834b88c807SRodney W. Grimestwo character sequence "^-" or the
3844b88c807SRodney W. Grimesstring "undef" the control character
385eccea571SRuslan Ermilovis disabled (i.e., set to
3864b88c807SRodney W. Grimes.Pf { Dv _POSIX_VDISABLE Ns } . )
3874b88c807SRodney W. Grimes.Pp
3884b88c807SRodney W. GrimesRecognized control-characters:
3894b88c807SRodney W. Grimes.Bd -ragged -offset indent
3904b88c807SRodney W. Grimes.Bl -column character Subscript
391748611c9SJoel Dahl.It control- Ta \& Ta \&
39212e720d7SRuslan Ermilov.It character Ta Subscript Ta Description
39312e720d7SRuslan Ermilov.It _________ Ta _________ Ta _______________
39412e720d7SRuslan Ermilov.It eof Ta Tn VEOF Ta EOF No character
39512e720d7SRuslan Ermilov.It eol Ta Tn VEOL Ta EOL No character
39612e720d7SRuslan Ermilov.It eol2 Ta Tn VEOL2 Ta EOL2 No character
39712e720d7SRuslan Ermilov.It erase Ta Tn VERASE Ta ERASE No character
39812e720d7SRuslan Ermilov.It erase2 Ta Tn VERASE2 Ta ERASE2 No character
39912e720d7SRuslan Ermilov.It werase Ta Tn VWERASE Ta WERASE No character
40012e720d7SRuslan Ermilov.It intr Ta Tn VINTR Ta INTR No character
40112e720d7SRuslan Ermilov.It kill Ta Tn VKILL Ta KILL No character
40212e720d7SRuslan Ermilov.It quit Ta Tn VQUIT Ta QUIT No character
40312e720d7SRuslan Ermilov.It susp Ta Tn VSUSP Ta SUSP No character
40412e720d7SRuslan Ermilov.It start Ta Tn VSTART Ta START No character
40512e720d7SRuslan Ermilov.It stop Ta Tn VSTOP Ta STOP No character
40612e720d7SRuslan Ermilov.It dsusp Ta Tn VDSUSP Ta DSUSP No character
40712e720d7SRuslan Ermilov.It lnext Ta Tn VLNEXT Ta LNEXT No character
40812e720d7SRuslan Ermilov.It reprint Ta Tn VREPRINT Ta REPRINT No character
40912e720d7SRuslan Ermilov.It status Ta Tn VSTATUS Ta STATUS No character
4104b88c807SRodney W. Grimes.El
4114b88c807SRodney W. Grimes.Ed
4124b88c807SRodney W. Grimes.It Cm min Ar number
4134b88c807SRodney W. Grimes.It Cm time Ar number
4144b88c807SRodney W. GrimesSet the value of min or time to
4154b88c807SRodney W. Grimesnumber.
4164b88c807SRodney W. Grimes.Dv MIN
4174b88c807SRodney W. Grimesand
4184b88c807SRodney W. Grimes.Dv TIME
4194b88c807SRodney W. Grimesare used in
4204b88c807SRodney W. GrimesNon-Canonical mode input processing
4214b88c807SRodney W. Grimes(-icanon).
4224b88c807SRodney W. Grimes.El
4234b88c807SRodney W. Grimes.Ss Combination Modes:
4244b88c807SRodney W. Grimes.Bl -tag -width Fl
4254b88c807SRodney W. Grimes.It Ar saved settings
4264b88c807SRodney W. GrimesSet the current terminal
4274b88c807SRodney W. Grimescharacteristics to the saved settings
4284b88c807SRodney W. Grimesproduced by the
4294b88c807SRodney W. Grimes.Fl g
4304b88c807SRodney W. Grimesoption.
4314b88c807SRodney W. Grimes.It Cm evenp No or Cm parity
4324b88c807SRodney W. GrimesEnable parenb and cs7; disable
4334b88c807SRodney W. Grimesparodd.
4344b88c807SRodney W. Grimes.It Cm oddp
4354b88c807SRodney W. GrimesEnable parenb, cs7, and parodd.
4364b88c807SRodney W. Grimes.It Fl parity , evenp , oddp
4374b88c807SRodney W. GrimesDisable parenb, and set cs8.
4384b88c807SRodney W. Grimes.It Cm \&nl Pq Fl \&nl
4394b88c807SRodney W. GrimesEnable (disable) icrnl.
4404b88c807SRodney W. GrimesIn addition
4414b88c807SRodney W. Grimes-nl unsets inlcr and igncr.
4424b88c807SRodney W. Grimes.It Cm ek
4434b88c807SRodney W. GrimesReset
4444660b141SJordan K. Hubbard.Dv ERASE ,
4454660b141SJordan K. Hubbard.Dv ERASE2 ,
4464b88c807SRodney W. Grimesand
4474b88c807SRodney W. Grimes.Dv KILL
4484b88c807SRodney W. Grimescharacters
4494b88c807SRodney W. Grimesback to system defaults.
4504b88c807SRodney W. Grimes.It Cm sane
4514b88c807SRodney W. GrimesResets all modes to reasonable values for interactive terminal use.
4524b88c807SRodney W. Grimes.It Cm tty
4534b88c807SRodney W. GrimesSet the line discipline to the standard terminal line discipline
4544b88c807SRodney W. Grimes.Dv TTYDISC .
4554b88c807SRodney W. Grimes.It Cm crt Pq Fl crt
4564b88c807SRodney W. GrimesSet (disable) all modes suitable for a CRT display device.
4574b88c807SRodney W. Grimes.It Cm kerninfo Pq Fl kerninfo
4584b88c807SRodney W. GrimesEnable (disable) the system generated status line associated with
4594b88c807SRodney W. Grimesprocessing a
4604b88c807SRodney W. Grimes.Dv STATUS
461eccea571SRuslan Ermilovcharacter (usually set to ^T).
462eccea571SRuslan ErmilovThe status line consists of the
4634b88c807SRodney W. Grimessystem load average, the current command name, its process ID, the
4644b88c807SRodney W. Grimesevent the process is waiting on (or the status of the process), the user
4654b88c807SRodney W. Grimesand system times, percent cpu, and current memory usage.
46693806cf9SConrad Meyer.Pp
46793806cf9SConrad MeyerIf the
46893806cf9SConrad Meyer.Xr sysctl 8
46993806cf9SConrad Meyervariable
47093806cf9SConrad Meyer.Va kern.tty_info_kstacks
47193806cf9SConrad Meyeris set to a non-zero value, the status message also includes the kernel program
47293806cf9SConrad Meyerstack of the foreground thread.
4734b88c807SRodney W. Grimes.It Cm columns Ar number
4744b88c807SRodney W. GrimesThe terminal size is recorded as having
4754b88c807SRodney W. Grimes.Ar number
4764b88c807SRodney W. Grimescolumns.
4774b88c807SRodney W. Grimes.It Cm cols Ar number
4784b88c807SRodney W. Grimesis an alias for
4794b88c807SRodney W. Grimes.Cm columns .
4804b88c807SRodney W. Grimes.It Cm rows Ar number
4814b88c807SRodney W. GrimesThe terminal size is recorded as having
4824b88c807SRodney W. Grimes.Ar number
4834b88c807SRodney W. Grimesrows.
4844b88c807SRodney W. Grimes.It Cm dec
48594ba280cSRuslan ErmilovSet modes suitable for users of Digital Equipment Corporation systems
48694ba280cSRuslan Ermilov.Dv ( ERASE ,
4874b88c807SRodney W. Grimes.Dv KILL ,
4884b88c807SRodney W. Grimesand
4894b88c807SRodney W. Grimes.Dv INTR
4904b88c807SRodney W. Grimescharacters are set to ^?, ^U, and ^C;
4914b88c807SRodney W. Grimes.Dv ixany
4924b88c807SRodney W. Grimesis disabled, and
4934b88c807SRodney W. Grimes.Dv crt
4944b88c807SRodney W. Grimesis enabled.)
4954b88c807SRodney W. Grimes.It Cm extproc Pq Fl extproc
4964b88c807SRodney W. GrimesIf set, this flag indicates that some amount of terminal processing is being
4974b88c807SRodney W. Grimesperformed by either the terminal hardware or by the remote side connected
4984b88c807SRodney W. Grimesto a pty.
4994b88c807SRodney W. Grimes.It Cm raw Pq Fl raw
5004b88c807SRodney W. GrimesIf set, change the modes of the terminal so that no input or output processing
501bef84d6bSSheldon Hearnis performed.
502bef84d6bSSheldon HearnIf unset, change the modes of the terminal to some reasonable
503eccea571SRuslan Ermilovstate that performs input and output processing.
504eccea571SRuslan ErmilovNote that since the
5054b88c807SRodney W. Grimesterminal driver no longer has a single
5064b88c807SRodney W. Grimes.Dv RAW
5074b88c807SRodney W. Grimesbit, it is not possible to intuit what flags were set prior to setting
5084b88c807SRodney W. Grimes.Cm raw .
5094b88c807SRodney W. GrimesThis means that unsetting
5104b88c807SRodney W. Grimes.Cm raw
5114b88c807SRodney W. Grimesmay not put back all the setting that were previously in effect.
5124b88c807SRodney W. GrimesTo set the terminal into a raw state and then accurately restore it, the following
5134b88c807SRodney W. Grimesshell code is recommended:
514726b61abSRuslan Ermilov.Bd -literal
5154b88c807SRodney W. Grimessave_state=$(stty -g)
5164b88c807SRodney W. Grimesstty raw
5174b88c807SRodney W. Grimes\&...
5184b88c807SRodney W. Grimesstty "$save_state"
519726b61abSRuslan Ermilov.Ed
5204b88c807SRodney W. Grimes.It Cm size
5214b88c807SRodney W. GrimesThe size of the terminal is printed as two numbers on a single line,
5224b88c807SRodney W. Grimesfirst rows, then columns.
5234b88c807SRodney W. Grimes.El
5244b88c807SRodney W. Grimes.Ss Compatibility Modes:
5254b88c807SRodney W. GrimesThese modes remain for compatibility with the previous version of
5269ba8bd65SPhilippe Charnierthe
5279ba8bd65SPhilippe Charnier.Nm
5289ba8bd65SPhilippe Charniercommand.
5294b88c807SRodney W. Grimes.Bl -tag -width Fl
5304b88c807SRodney W. Grimes.It Cm all
5314b88c807SRodney W. GrimesReports all the terminal modes as with
5324b88c807SRodney W. Grimes.Cm stty Fl a
5334b88c807SRodney W. Grimesexcept that the control characters are printed in a columnar format.
5344b88c807SRodney W. Grimes.It Cm everything
5354b88c807SRodney W. GrimesSame as
5364b88c807SRodney W. Grimes.Cm all .
5374b88c807SRodney W. Grimes.It Cm cooked
5384b88c807SRodney W. GrimesSame as
5394b88c807SRodney W. Grimes.Cm sane .
5404b88c807SRodney W. Grimes.It Cm cbreak
5414b88c807SRodney W. GrimesIf set, enables
5424b88c807SRodney W. Grimes.Cm brkint , ixon , imaxbel , opost ,
5434b88c807SRodney W. Grimes.Cm isig , iexten ,
5444b88c807SRodney W. Grimesand
545c2d03ea8SRuslan Ermilov.Fl icanon .
5464b88c807SRodney W. GrimesIf unset, same as
5474b88c807SRodney W. Grimes.Cm sane .
5484b88c807SRodney W. Grimes.It Cm new
5494b88c807SRodney W. GrimesSame as
5504b88c807SRodney W. Grimes.Cm tty .
5514b88c807SRodney W. Grimes.It Cm old
5524b88c807SRodney W. GrimesSame as
5534b88c807SRodney W. Grimes.Cm tty .
5544b88c807SRodney W. Grimes.It Cm newcrt Pq Fl newcrt
5554b88c807SRodney W. GrimesSame as
5564b88c807SRodney W. Grimes.Cm crt .
5574b88c807SRodney W. Grimes.It Cm pass8
5584b88c807SRodney W. GrimesThe converse of
5594b88c807SRodney W. Grimes.Cm parity .
5604b88c807SRodney W. Grimes.It Cm tandem Pq Fl tandem
5614b88c807SRodney W. GrimesSame as
5624b88c807SRodney W. Grimes.Cm ixoff .
5634b88c807SRodney W. Grimes.It Cm decctlq Pq Fl decctlq
5644b88c807SRodney W. GrimesThe converse of
5654b88c807SRodney W. Grimes.Cm ixany .
5664b88c807SRodney W. Grimes.It Cm crterase Pq Fl crterase
5674b88c807SRodney W. GrimesSame as
5684b88c807SRodney W. Grimes.Cm echoe .
5694b88c807SRodney W. Grimes.It Cm crtbs Pq Fl crtbs
5704b88c807SRodney W. GrimesSame as
5714b88c807SRodney W. Grimes.Cm echoe .
5724b88c807SRodney W. Grimes.It Cm crtkill Pq Fl crtkill
5734b88c807SRodney W. GrimesSame as
5744b88c807SRodney W. Grimes.Cm echoke .
5754b88c807SRodney W. Grimes.It Cm ctlecho Pq Fl ctlecho
5764b88c807SRodney W. GrimesSame as
5774b88c807SRodney W. Grimes.Cm echoctl .
5784b88c807SRodney W. Grimes.It Cm prterase Pq Fl prterase
5794b88c807SRodney W. GrimesSame as
5804b88c807SRodney W. Grimes.Cm echoprt .
5814b88c807SRodney W. Grimes.It Cm litout Pq Fl litout
5824b88c807SRodney W. GrimesThe converse of
5834b88c807SRodney W. Grimes.Cm opost .
584f8f8c9f0SEd Schouten.It Cm oxtabs Pq Fl oxtabs
585f8f8c9f0SEd SchoutenExpand (do not expand) tabs to spaces on output.
5864b88c807SRodney W. Grimes.It Cm tabs Pq Fl tabs
5874b88c807SRodney W. GrimesThe converse of
588e7030de8SMike Pritchard.Cm oxtabs .
5894b88c807SRodney W. Grimes.It Cm brk Ar value
5904b88c807SRodney W. GrimesSame as the control character
5914b88c807SRodney W. Grimes.Cm eol .
5924b88c807SRodney W. Grimes.It Cm flush Ar value
5934b88c807SRodney W. GrimesSame as the control character
5944b88c807SRodney W. Grimes.Cm discard .
5954b88c807SRodney W. Grimes.It Cm rprnt Ar value
5964b88c807SRodney W. GrimesSame as the control character
5974b88c807SRodney W. Grimes.Cm reprint .
5984b88c807SRodney W. Grimes.El
599a7eac018SKonstantin Belousov.Sh INTERACTION WITH JOB CONTROL
600a7eac018SKonstantin BelousovModifications to the terminal settings are treated by job control
601a7eac018SKonstantin Belousov(see
602a7eac018SKonstantin Belousov.Xr termios 4 )
603a7eac018SKonstantin Belousovsame as writes.
604a7eac018SKonstantin BelousovWhen the
605a7eac018SKonstantin Belousov.Nm
606a7eac018SKonstantin Belousovutility is executing in a background process group,
607a7eac018SKonstantin Belousovsuch attempts result in the kernel sending the
608a7eac018SKonstantin Belousov.Dv SIGTTOU
609a7eac018SKonstantin Belousovsignal and stopping the process until its group is returned
610a7eac018SKonstantin Belousovto foreground.
611a7eac018SKonstantin BelousovThe non-blocking open of the terminal device with the
612a7eac018SKonstantin Belousov.Fl f
613a7eac018SKonstantin Belousovoption to
614a7eac018SKonstantin Belousov.Nm
615a7eac018SKonstantin Belousovdoes not affect the behavior.
616a7eac018SKonstantin BelousovIf it is desirable to modify the settings from the background,
617a7eac018SKonstantin Belousov.Xr sh 1
618a7eac018SKonstantin Belousovusers might utilize the following idiom:
619a7eac018SKonstantin Belousov.Bd -literal
620a7eac018SKonstantin Belousov(trap '' TTOU; stty -f /dev/tty sane)
621a7eac018SKonstantin Belousov.Ed
622a7eac018SKonstantin Belousov.Pp
623a7eac018SKonstantin BelousovNote that changing terminal settings for a running foreground
624a7eac018SKonstantin Belousovjob that is not prepared for it might cause inconsistencies.
6256fca4c7cSRuslan Ermilov.Sh EXIT STATUS
626d628d776SRuslan Ermilov.Ex -std
6274b88c807SRodney W. Grimes.Sh SEE ALSO
628452bdaabSEdward Tomasz Napierala.Xr resizewin 1 ,
6297a467312SEdward Tomasz Napierala.Xr termios 4 ,
6307a467312SEdward Tomasz Napierala.Xr pstat 8
6314b88c807SRodney W. Grimes.Sh STANDARDS
6324b88c807SRodney W. GrimesThe
6339ba8bd65SPhilippe Charnier.Nm
634a240291aSBrian Feldmanutility is expected to be
6354b88c807SRodney W. Grimes.St -p1003.2
636eccea571SRuslan Ermilovcompatible.
637eccea571SRuslan ErmilovThe flags
6384b88c807SRodney W. Grimes.Fl e
6394b88c807SRodney W. Grimesand
6404b88c807SRodney W. Grimes.Fl f
6414b88c807SRodney W. Grimesare
6424b88c807SRodney W. Grimesextensions to the standard.
6433578fc3eSSevan Janiyan.Sh HISTORY
6443578fc3eSSevan JaniyanA
6453578fc3eSSevan Janiyan.Nm
6463578fc3eSSevan Janiyancommand appeared in
6473578fc3eSSevan Janiyan.At v2 .
648