2 .\" Copyright (c) 1990, 1993, 1994
3 .\" The Regents of the University of California. All rights reserved.
5 .\" This code is derived from software contributed to Berkeley by
6 .\" the Institute of Electrical and Electronics Engineers, Inc.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
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.
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
32 .\" @(#)stty.1 8.4 (Berkeley) 4/18/94
40 .Nd set the options for a terminal device interface
49 utility sets or reports on terminal
50 characteristics for the device that is its standard input.
51 If no options or arguments are specified, it reports the settings of a subset
52 of characteristics as well as additional ones if they differ from their
55 the terminal state according to the specified arguments.
56 Some combinations of arguments are mutually
57 exclusive on some terminal types.
59 The following options are available:
60 .Bl -tag -width indent
62 Display all the current settings for the terminal to standard output
66 Display all the current settings for the terminal to standard output
69 ``all'' and ``everything'' formats.
71 Open and use the terminal named by
73 rather than using standard input.
80 set or display settings on a terminal that might otherwise
83 Display all the current settings for the terminal to standard output
84 in a form that may be used as an argument to a subsequent invocation of
86 to restore the current terminal state as per
90 The following arguments are available to set the terminal
93 Control mode flags affect hardware characteristics associated with the
95 This corresponds to the c_cflag in the termios structure.
97 .It Cm parenb Pq Fl parenb
98 Enable (disable) parity generation
100 .It Cm parodd Pq Fl parodd
101 Select odd (even) parity.
102 .It Cm cs5 cs6 cs7 cs8
103 Select character size, if possible.
105 Set terminal baud rate to the
106 number given, if possible.
108 baud rate is set to zero, modem
111 .It Cm ispeed Ar number
112 Set terminal input baud rate to the
113 number given, if possible.
115 input baud rate is set to zero, the
116 input baud rate is set to the
117 value of the output baud
119 .It Cm ospeed Ar number
120 Set terminal output baud rate to
121 the number given, if possible.
123 the output baud rate is set to
124 zero, modem control is
126 .It Cm speed Ar number
133 .It Cm hupcl Pq Fl hupcl
134 Stop asserting modem control
135 (do not stop asserting modem control) on last close.
139 .It Cm cstopb Pq Fl cstopb
140 Use two (one) stop bits per character.
141 .It Cm cread Pq Fl cread
142 Enable (disable) the receiver.
143 .It Cm clocal Pq Fl clocal
144 Assume a line without (with) modem
146 .It Cm crtscts Pq Fl crtscts
147 Enable (disable) RTS/CTS flow control.
150 This corresponds to the c_iflag in the termios structure.
152 .It Cm ignbrk Pq Fl ignbrk
153 Ignore (do not ignore) break on
155 .It Cm brkint Pq Fl brkint
156 Signal (do not signal)
160 .It Cm ignpar Pq Fl ignpar
161 Ignore (do not ignore) characters with parity
163 .It Cm parmrk Pq Fl parmrk
164 Mark (do not mark) characters with parity errors.
165 .It Cm inpck Pq Fl inpck
166 Enable (disable) input parity
168 .It Cm istrip Pq Fl istrip
169 Strip (do not strip) input characters
171 .It Cm inlcr Pq Fl inlcr
177 .It Cm igncr Pq Fl igncr
178 Ignore (do not ignore)
181 .It Cm icrnl Pq Fl icrnl
187 .It Cm ixon Pq Fl ixon
192 Output from the system is
193 stopped when the system receives
195 and started when the system
200 is set, any character restarts output.
201 .It Cm ixoff Pq Fl ixoff
202 Request that the system send (not
206 the input queue is nearly
208 .It Cm ixany Pq Fl ixany
209 Allow any character (allow only
212 .It Cm imaxbel Pq Fl imaxbel
213 The system imposes a limit of
215 (currently 255) characters in the input queue.
218 is set and the input queue limit has been reached,
219 subsequent input causes the system to send an ASCII BEL
220 character to the output queue (the terminal beeps at you).
224 is unset and the input queue is full, the next input character causes
225 the entire input and output queues to be discarded.
228 This corresponds to the c_oflag of the termios structure.
230 .It Cm opost Pq Fl opost
231 Post-process output (do not
232 post-process output; ignore all other
234 .It Cm onlcr Pq Fl onlcr
240 .It Cm ocrnl Pq Fl ocrnl
247 Select tab expansion policy.
249 disables tab expansion, while
252 .It Cm onocr Pq Fl onocr
253 Do not (do) output CRs at column zero.
254 .It Cm onlret Pq Fl onlret
255 On the terminal NL performs (does not perform) the CR function.
258 Local mode flags (lflags) affect various and sundry characteristics of terminal
260 Historically the term "local" pertained to new job control features
261 implemented by Jim Kulp on a
265 Later the driver ran on the first
267 at Evans Hall, UC Berkeley, where the job control details
268 were greatly modified but the structure definitions and names
269 remained essentially unchanged.
270 The second interpretation of the 'l' in lflag
271 is ``line discipline flag'' which corresponds to the
277 .It Cm isig Pq Fl isig
278 Enable (disable) the checking of
279 characters against the special control
284 .It Cm icanon Pq Fl icanon
285 Enable (disable) canonical input
290 .It Cm iexten Pq Fl iexten
291 Enable (disable) any implementation
292 defined special control characters
293 not currently controlled by icanon,
295 .It Cm echo Pq Fl echo
296 Echo back (do not echo back) every
298 .It Cm echoe Pq Fl echoe
301 character shall (shall
302 not) visually erase the last character
303 in the current line from the
304 display, if possible.
305 .It Cm echok Pq Fl echok
311 .It Cm echoke Pq Fl echoke
314 character shall (shall
315 not) visually erase the
316 current line from the
317 display, if possible.
318 .It Cm echonl Pq Fl echonl
323 .It Cm echoctl Pq Fl echoctl
326 is set, echo control characters as ^X.
327 Otherwise control characters
329 .It Cm echoprt Pq Fl echoprt
330 For printing terminals.
331 If set, echo erased characters backwards within ``\\''
333 Otherwise, disable this feature.
334 .It Cm noflsh Pq Fl noflsh
335 Disable (enable) flush after
336 .Dv INTR , QUIT , SUSP .
337 .It Cm tostop Pq Fl tostop
340 for background output.
341 This causes background jobs to stop if they attempt
343 .It Cm altwerase Pq Fl altwerase
344 Use (do not use) an alternate word erase algorithm when processing
347 This alternate algorithm considers sequences of
348 alphanumeric/underscores as words.
349 It also skips the first preceding character in its classification
350 (as a convenience since the one preceding character could have been
351 erased with simply an
354 .It Cm mdmbuf Pq Fl mdmbuf
355 If set, flow control output based on condition of Carrier Detect.
357 writes return an error if Carrier Detect is low (and Carrier is not being
361 .It Cm flusho Pq Fl flusho
362 Indicates output is (is not) being discarded.
363 .It Cm pendin Pq Fl pendin
364 Indicates input is (is not) pending after a switch from non-canonical
365 to canonical mode and will be re-input when a read becomes pending
366 or more input arrives.
368 .Ss Control Characters:
370 .It Ar control-character Ar string
372 .Ar control-character
375 If string is a single character,
376 the control character is set to
379 two character sequence "^-" or the
380 string "undef" the control character
381 is disabled (i.e., set to
382 .Pf { Dv _POSIX_VDISABLE Ns } . )
384 Recognized control-characters:
385 .Bd -ragged -offset indent
386 .Bl -column character Subscript
387 .It control- Ta \& Ta \&
388 .It character Ta Subscript Ta Description
389 .It _________ Ta _________ Ta _______________
390 .It eof Ta Tn VEOF Ta EOF No character
391 .It eol Ta Tn VEOL Ta EOL No character
392 .It eol2 Ta Tn VEOL2 Ta EOL2 No character
393 .It erase Ta Tn VERASE Ta ERASE No character
394 .It erase2 Ta Tn VERASE2 Ta ERASE2 No character
395 .It werase Ta Tn VWERASE Ta WERASE No character
396 .It intr Ta Tn VINTR Ta INTR No character
397 .It kill Ta Tn VKILL Ta KILL No character
398 .It quit Ta Tn VQUIT Ta QUIT No character
399 .It susp Ta Tn VSUSP Ta SUSP No character
400 .It start Ta Tn VSTART Ta START No character
401 .It stop Ta Tn VSTOP Ta STOP No character
402 .It dsusp Ta Tn VDSUSP Ta DSUSP No character
403 .It lnext Ta Tn VLNEXT Ta LNEXT No character
404 .It reprint Ta Tn VREPRINT Ta REPRINT No character
405 .It status Ta Tn VSTATUS Ta STATUS No character
409 .It Cm time Ar number
410 Set the value of min or time to
416 Non-Canonical mode input processing
419 .Ss Combination Modes:
421 .It Ar saved settings
422 Set the current terminal
423 characteristics to the saved settings
427 .It Cm evenp No or Cm parity
428 Enable parenb and cs7; disable
431 Enable parenb, cs7, and parodd.
432 .It Fl parity , evenp , oddp
433 Disable parenb, and set cs8.
434 .It Cm \&nl Pq Fl \&nl
435 Enable (disable) icrnl.
437 -nl unsets inlcr and igncr.
445 back to system defaults.
447 Resets all modes to reasonable values for interactive terminal use.
449 Set the line discipline to the standard terminal line discipline
452 Set (disable) all modes suitable for a CRT display device.
453 .It Cm kerninfo Pq Fl kerninfo
454 Enable (disable) the system generated status line associated with
457 character (usually set to ^T).
458 The status line consists of the
459 system load average, the current command name, its process ID, the
460 event the process is waiting on (or the status of the process), the user
461 and system times, percent cpu, and current memory usage.
462 .It Cm columns Ar number
463 The terminal size is recorded as having
466 .It Cm cols Ar number
469 .It Cm rows Ar number
470 The terminal size is recorded as having
474 Set modes suitable for users of Digital Equipment Corporation systems
479 characters are set to ^?, ^U, and ^C;
484 .It Cm extproc Pq Fl extproc
485 If set, this flag indicates that some amount of terminal processing is being
486 performed by either the terminal hardware or by the remote side connected
489 If set, change the modes of the terminal so that no input or output processing
491 If unset, change the modes of the terminal to some reasonable
492 state that performs input and output processing.
494 terminal driver no longer has a single
496 bit, it is not possible to intuit what flags were set prior to setting
498 This means that unsetting
500 may not put back all the setting that were previously in effect.
501 To set the terminal into a raw state and then accurately restore it, the following
502 shell code is recommended:
504 save_state=$(stty -g)
510 The size of the terminal is printed as two numbers on a single line,
511 first rows, then columns.
513 .Ss Compatibility Modes:
514 These modes remain for compatibility with the previous version of
520 Reports all the terminal modes as with
522 except that the control characters are printed in a columnar format.
531 .Cm brkint , ixon , imaxbel , opost ,
543 .It Cm newcrt Pq Fl newcrt
549 .It Cm tandem Pq Fl tandem
552 .It Cm decctlq Pq Fl decctlq
555 .It Cm crterase Pq Fl crterase
558 .It Cm crtbs Pq Fl crtbs
561 .It Cm crtkill Pq Fl crtkill
564 .It Cm ctlecho Pq Fl ctlecho
567 .It Cm prterase Pq Fl prterase
570 .It Cm litout Pq Fl litout
573 .It Cm oxtabs Pq Fl oxtabs
574 Expand (do not expand) tabs to spaces on output.
575 .It Cm tabs Pq Fl tabs
579 Same as the control character
581 .It Cm flush Ar value
582 Same as the control character
584 .It Cm rprnt Ar value
585 Same as the control character
595 utility is expected to be
603 extensions to the standard.