1STTY(1P)                   POSIX Programmer's Manual                  STTY(1P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10
11

NAME

13       stty — set the options for a terminal
14

SYNOPSIS

16       stty [−a|−g]
17
18       stty operand...
19

DESCRIPTION

21       The stty utility shall set or report on  terminal  I/O  characteristics
22       for  the device that is its standard input. Without options or operands
23       specified, it shall report the  settings  of  certain  characteristics,
24       usually those that differ from implementation-defined defaults.  Other‐
25       wise, it shall modify the terminal state according to the specified op‐
26       erands.  Detailed  information about the modes listed in the first five
27       groups  below  are  described  in  the  Base  Definitions   volume   of
28       POSIX.1‐2008,  Chapter 11, General Terminal Interface.  Operands in the
29       Combination Modes group (see Combination Modes) are  implemented  using
30       operands  in  the  previous  groups.  Some combinations of operands are
31       mutually-exclusive on some terminal types; the results  of  using  such
32       combinations are unspecified.
33
34       Typical  implementations  of this utility require a communications line
35       configured to use the termios interface defined in  the  System  Inter‐
36       faces  volume of POSIX.1‐2008. On systems where none of these lines are
37       available, and on lines not currently configured to support the termios
38       interface,  some  of the operands need not affect terminal characteris‐
39       tics.
40

OPTIONS

42       The stty utility shall  conform  to  the  Base  Definitions  volume  of
43       POSIX.1‐2008, Section 12.2, Utility Syntax Guidelines.
44
45       The following options shall be supported:
46
47       −a        Write  to  standard  output  all the current settings for the
48                 terminal.
49
50       −g        Write to standard output  all  the  current  settings  in  an
51                 unspecified  form  that  can  be used as arguments to another
52                 invocation of the stty utility on the same system.  The  form
53                 used  shall  not  contain  any  characters that would require
54                 quoting to avoid word expansion by  the  shell;  see  Section
55                 2.6, Word Expansions.
56

OPERANDS

58       The  following  operands shall be supported to set the terminal charac‐
59       teristics.
60
61   Control Modes
62       parenb (−parenb)
63                   Enable (disable)  parity  generation  and  detection.  This
64                   shall  have  the  effect of setting (not setting) PARENB in
65                   the termios c_cflag field, as defined in the  Base  Defini‐
66                   tions  volume of POSIX.1‐2008, Chapter 11, General Terminal
67                   Interface.
68
69       parodd (−parodd)
70                   Select odd (even) parity. This shall  have  the  effect  of
71                   setting  (not setting) PARODD in the termios c_cflag field,
72                   as defined in the Base Definitions volume of  POSIX.1‐2008,
73                   Chapter 11, General Terminal Interface.
74
75       cs5 cs6 cs7 cs8
76                   Select  character  size,  if  possible. This shall have the
77                   effect of setting CS5, CS6, CS7, and CS8, respectively,  in
78                   the  termios  c_cflag field, as defined in the Base Defini‐
79                   tions volume of POSIX.1‐2008, Chapter 11, General  Terminal
80                   Interface.
81
82       number      Set terminal baud rate to the number given, if possible. If
83                   the baud rate is set to zero, the modem control lines shall
84                   no  longer  be asserted. This shall have the effect of set‐
85                   ting the input and  output  termios  baud  rate  values  as
86                   defined  in  the  Base  Definitions volume of POSIX.1‐2008,
87                   Chapter 11, General Terminal Interface.
88
89       ispeed number
90                   Set terminal input baud rate to the number given, if possi‐
91                   ble.  If the input baud rate is set to zero, the input baud
92                   rate shall be specified by the value  of  the  output  baud
93                   rate.  This  shall  have  the  effect  of setting the input
94                   termios baud rate values as defined in the Base Definitions
95                   volume of POSIX.1‐2008, Chapter 11, General Terminal Inter‐
96                   face.
97
98       ospeed number
99                   Set terminal output baud rate to the number given, if  pos‐
100                   sible.  If  the  output baud rate is set to zero, the modem
101                   control lines shall no longer be asserted. This shall  have
102                   the  effect  of setting the output termios baud rate values
103                   as defined in the Base Definitions volume of  POSIX.1‐2008,
104                   Chapter 11, General Terminal Interface.
105
106       hupcl (−hupcl)
107                   Stop  asserting  modem control lines (do not stop asserting
108                   modem control lines) on last close.  This  shall  have  the
109                   effect  of  setting  (not  setting)  HUPCL  in  the termios
110                   c_cflag field, as defined in the Base Definitions volume of
111                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
112
113       hup (−hup)  Equivalent to hupcl(−hupcl).
114
115       cstopb (−cstopb)
116                   Use  two (one) stop bits per character. This shall have the
117                   effect of setting  (not  setting)  CSTOPB  in  the  termios
118                   c_cflag field, as defined in the Base Definitions volume of
119                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
120
121       cread (−cread)
122                   Enable (disable) the receiver. This shall have  the  effect
123                   of  setting  (not  setting)  CREAD  in  the termios c_cflag
124                   field,  as  defined  in  the  Base  Definitions  volume  of
125                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
126
127       clocal (−clocal)
128                   Assume a line without (with) modem control. This shall have
129                   the effect of setting (not setting) CLOCAL in  the  termios
130                   c_cflag field, as defined in the Base Definitions volume of
131                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
132
133       It is unspecified whether stty shall report an error if an  attempt  to
134       set a Control Mode fails.
135
136   Input Modes
137       ignbrk (−ignbrk)
138                   Ignore  (do not ignore) break on input. This shall have the
139                   effect of setting  (not  setting)  IGNBRK  in  the  termios
140                   c_iflag field, as defined in the Base Definitions volume of
141                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
142
143       brkint (−brkint)
144                   Signal (do not signal) INTR on break. This shall  have  the
145                   effect  of  setting  (not  setting)  BRKINT  in the termios
146                   c_iflag field, as defined in the Base Definitions volume of
147                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
148
149       ignpar (−ignpar)
150                   Ignore (do not ignore) bytes with parity errors. This shall
151                   have the effect of setting  (not  setting)  IGNPAR  in  the
152                   termios  c_iflag  field, as defined in the Base Definitions
153                   volume of POSIX.1‐2008, Chapter 11, General Terminal Inter‐
154                   face.
155
156       parmrk (−parmrk)
157                   Mark  (do  not  mark)  parity  errors.  This shall have the
158                   effect of setting  (not  setting)  PARMRK  in  the  termios
159                   c_iflag field, as defined in the Base Definitions volume of
160                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
161
162       inpck (−inpck)
163                   Enable (disable) input parity checking. This shall have the
164                   effect  of  setting  (not  setting)  INPCK  in  the termios
165                   c_iflag field, as defined in the Base Definitions volume of
166                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
167
168       istrip (−istrip)
169                   Strip  (do  not strip) input characters to seven bits. This
170                   shall have the effect of setting (not  setting)  ISTRIP  in
171                   the  termios  c_iflag field, as defined in the Base Defini‐
172                   tions volume of POSIX.1‐2008, Chapter 11, General  Terminal
173                   Interface.
174
175       inlcr (−inlcr)
176                   Map  (do  not  map)  NL to CR on input. This shall have the
177                   effect of  setting  (not  setting)  INLCR  in  the  termios
178                   c_iflag field, as defined in the Base Definitions volume of
179                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
180
181       igncr (−igncr)
182                   Ignore (do not ignore) CR on input.  This  shall  have  the
183                   effect  of  setting  (not  setting)  IGNCR  in  the termios
184                   c_iflag field, as defined in the Base Definitions volume of
185                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
186
187       icrnl (−icrnl)
188                   Map  (do  not  map)  CR to NL on input. This shall have the
189                   effect of  setting  (not  setting)  ICRNL  in  the  termios
190                   c_iflag field, as defined in the Base Definitions volume of
191                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
192
193       ixon (−ixon)
194                   Enable (disable) START/STOP output control. Output from the
195                   system is stopped when the system receives STOP and started
196                   when the system receives START. This shall have the  effect
197                   of setting (not setting) IXON in the termios c_iflag field,
198                   as defined in the Base Definitions volume of  POSIX.1‐2008,
199                   Chapter 11, General Terminal Interface.
200
201       ixany (−ixany)
202                   Allow  any character to restart output. This shall have the
203                   effect of  setting  (not  setting)  IXANY  in  the  termios
204                   c_iflag field, as defined in the Base Definitions volume of
205                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
206
207       ixoff (−ixoff)
208                   Request that the system send  (not  send)  STOP  characters
209                   when the input queue is nearly full and START characters to
210                   resume data transmission.  This shall have  the  effect  of
211                   setting  (not  setting) IXOFF in the termios c_iflag field,
212                   as defined in the Base Definitions volume of  POSIX.1‐2008,
213                   Chapter 11, General Terminal Interface.
214
215   Output Modes
216       opost (−opost)
217                   Post-process output (do not post-process output; ignore all
218                   other output modes). This shall have the effect of  setting
219                   (not  setting)  OPOST  in  the  termios  c_oflag  field, as
220                   defined in the Base  Definitions  volume  of  POSIX.1‐2008,
221                   Chapter 11, General Terminal Interface.
222
223       ocrnl (−ocrnl)
224                   Map  (do  not  map)  CR to NL on output This shall have the
225                   effect of  setting  (not  setting)  OCRNL  in  the  termios
226                   c_oflag field, as defined in the Base Definitions volume of
227                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
228
229       onocr (−onocr)
230                   Do not (do) output CR at column zero. This shall  have  the
231                   effect  of  setting  (not  setting)  ONOCR  in  the termios
232                   c_oflag field, as defined in the Base Definitions volume of
233                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
234
235       onlret (−onlret)
236                   The terminal newline key performs (does not perform) the CR
237                   function.  This shall have the effect of setting (not  set‐
238                   ting)  ONLRET  in  the termios c_oflag field, as defined in
239                   the Base Definitions volume of  POSIX.1‐2008,  Chapter  11,
240                   General Terminal Interface.
241
242       ofill (−ofill)
243                   Use  fill  characters  (use  timing) for delays. This shall
244                   have the effect of  setting  (not  setting)  OFILL  in  the
245                   termios  c_oflag  field, as defined in the Base Definitions
246                   volume of POSIX.1‐2008, Chapter 11, General Terminal Inter‐
247                   face.
248
249       ofdel (−ofdel)
250                   Fill characters are DELs (NULs). This shall have the effect
251                   of setting (not  setting)  OFDEL  in  the  termios  c_oflag
252                   field,  as  defined  in  the  Base  Definitions  volume  of
253                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
254
255       cr0 cr1 cr2 cr3
256                   Select the style of delay for  CRs.  This  shall  have  the
257                   effect  of  setting CRDLY to CR0, CR1, CR2, or CR3, respec‐
258                   tively, in the termios c_oflag field,  as  defined  in  the
259                   Base  Definitions  volume of POSIX.1‐2008, Chapter 11, Gen‐
260                   eral Terminal Interface.
261
262       nl0 nl1     Select the style of delay  for  NL.  This  shall  have  the
263                   effect of setting NLDLY to NL0 or NL1, respectively, in the
264                   termios c_oflag field, as defined in the  Base  Definitions
265                   volume of POSIX.1‐2008, Chapter 11, General Terminal Inter‐
266                   face.
267
268       tab0 tab1 tab2 tab3
269                   Select the style of delay for horizontal tabs.  This  shall
270                   have  the  effect of setting TABDLY to TAB0, TAB1, TAB2, or
271                   TAB3,  respectively,  in  the  termios  c_oflag  field,  as
272                   defined  in  the  Base  Definitions volume of POSIX.1‐2008,
273                   Chapter 11, General Terminal Interface.  Note that TAB3 has
274                   the effect of expanding <tab> characters to <space> charac‐
275                   ters.
276
277       tabs (−tabs)
278                   Synonym for tab0 (tab3).
279
280       bs0 bs1     Select the style of delay for <backspace> characters.  This
281                   shall  have  the  effect  of  setting  BSDLY to BS0 or BS1,
282                   respectively, in the termios c_oflag field, as  defined  in
283                   the  Base  Definitions  volume of POSIX.1‐2008, Chapter 11,
284                   General Terminal Interface.
285
286       ff0 ff1     Select the style of delay for <form-feed> characters.  This
287                   shall  have  the  effect  of  setting  FFDLY to FF0 or FF1,
288                   respectively, in the termios c_oflag field, as  defined  in
289                   the  Base  Definitions  volume of POSIX.1‐2008, Chapter 11,
290                   General Terminal Interface.
291
292       vt0 vt1     Select the style of delay  for  <vertical-tab>  characters.
293                   This  shall have the effect of setting VTDLY to VT0 or VT1,
294                   respectively, in the termios c_oflag field, as  defined  in
295                   the  Base  Definitions  volume of POSIX.1‐2008, Chapter 11,
296                   General Terminal Interface.
297
298   Local Modes
299       isig (−isig)
300                   Enable (disable) the checking  of  characters  against  the
301                   special control characters INTR, QUIT, and SUSP. This shall
302                   have the effect  of  setting  (not  setting)  ISIG  in  the
303                   termios  c_lflag  field, as defined in the Base Definitions
304                   volume of POSIX.1‐2008, Chapter 11, General Terminal Inter‐
305                   face.
306
307       icanon (−icanon)
308                   Enable  (disable)  canonical input (ERASE and KILL process‐
309                   ing). This shall have the effect of setting  (not  setting)
310                   ICANON in the termios c_lflag field, as defined in the Base
311                   Definitions volume of  POSIX.1‐2008,  Chapter  11,  General
312                   Terminal Interface.
313
314       iexten (−iexten)
315                   Enable (disable) any implementation-defined special control
316                   characters not currently controlled by icanon, isig,  ixon,
317                   or  ixoff.  This shall have the effect of setting (not set‐
318                   ting) IEXTEN in the termios c_lflag field,  as  defined  in
319                   the  Base  Definitions  volume of POSIX.1‐2008, Chapter 11,
320                   General Terminal Interface.
321
322       echo (−echo)
323                   Echo back (do not echo back) every  character  typed.  This
324                   shall  have the effect of setting (not setting) ECHO in the
325                   termios c_lflag field, as defined in the  Base  Definitions
326                   volume of POSIX.1‐2008, Chapter 11, General Terminal Inter‐
327                   face.
328
329       echoe (−echoe)
330                   The ERASE character visually erases (does  not  erase)  the
331                   last  character  in  the  current line from the display, if
332                   possible. This shall have the effect of setting  (not  set‐
333                   ting) ECHOE in the termios c_lflag field, as defined in the
334                   Base Definitions volume of POSIX.1‐2008, Chapter  11,  Gen‐
335                   eral Terminal Interface.
336
337       echok (−echok)
338                   Echo (do not echo) NL after KILL character. This shall have
339                   the effect of setting (not setting) ECHOK  in  the  termios
340                   c_lflag field, as defined in the Base Definitions volume of
341                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
342
343       echonl (−echonl)
344                   Echo (do not echo) NL, even if echo is disabled. This shall
345                   have  the  effect  of  setting  (not setting) ECHONL in the
346                   termios c_lflag field, as defined in the  Base  Definitions
347                   volume of POSIX.1‐2008, Chapter 11, General Terminal Inter‐
348                   face.
349
350       noflsh (−noflsh)
351                   Disable (enable) flush after INTR, QUIT, SUSP.  This  shall
352                   have  the  effect  of  setting  (not setting) NOFLSH in the
353                   termios c_lflag field, as defined in the  Base  Definitions
354                   volume of POSIX.1‐2008, Chapter 11, General Terminal Inter‐
355                   face.
356
357       tostop (−tostop)
358                   Send SIGTTOU for background output.  This  shall  have  the
359                   effect  of  setting  (not  setting)  TOSTOP  in the termios
360                   c_lflag field, as defined in the Base Definitions volume of
361                   POSIX.1‐2008, Chapter 11, General Terminal Interface.
362
363   Special Control Character Assignments
364       <control>‐character string
365             Set <control>‐character to string.  If <control>‐character is one
366             of the character sequences in the first column of  the  following
367             table,   the   corresponding   the  Base  Definitions  volume  of
368             POSIX.1‐2008, Chapter  11,  General  Terminal  Interface  control
369             character  from  the  second column shall be recognized. This has
370             the effect of setting the corresponding element  of  the  termios
371             c_cc  array  (see  the  Base  Definitions volume of POSIX.1‐2008,
372             Chapter 13, Headers, <termios.h>).
373
374                          Table: Control Character Names in stty
375
376                  ┌──────────────────┬────────────────┬─────────────────┐
377Control Character c_cc Subscript Description   
378                  ├──────────────────┼────────────────┼─────────────────┤
379eof               │ VEOF           │ EOF character   │
380eol               │ VEOL           │ EOL character   │
381erase             │ VERASE         │ ERASE character │
382intr              │ VINTR          │ INTR character  │
383kill              │ VKILL          │ KILL character  │
384quit              │ VQUIT          │ QUIT character  │
385susp              │ VSUSP          │ SUSP character  │
386start             │ VSTART         │ START character │
387stop              │ VSTOP          │ STOP character  │
388                  └──────────────────┴────────────────┴─────────────────┘
389             If string is a single character, the control character  shall  be
390             set  to  that  character. If string is the two-character sequence
391             "^−" or the string undef, the control character shall be  set  to
392             _POSIX_VDISABLE  ,  if  it  is  in  effect  for  the  device;  if
393             _POSIX_VDISABLE is not in effect for  the  device,  it  shall  be
394             treated  as  an  error.  In the POSIX locale, if string is a two-
395             character sequence beginning with  <circumflex>  ('^'),  and  the
396             second character is one of those listed in the "^c" column of the
397             following table, the control character shall be set to the corre‐
398             sponding character value in the Value column of the table.
399
400                       Table: Circumflex Control Characters in stty
401
402                      ┌──────────────┬────────────────┬──────────────┐
403^c   Value   ^c   Value   ^c   Value 
404                      ├──────────────┼────────────────┼──────────────┤
405                      │a, A  <SOH>   │  l, L  <FF>    │  w, W  <ETB> │
406                      │b, B  <STX>   │  m, M  <CR>    │  x, X  <CAN> │
407                      │c, C  <ETX>   │  n, N  <SO>    │  y, Y  <EM>  │
408                      │d, D  <EOT>   │  o, O  <SI>    │  z, Z  <SUB> │
409                      │e, E  <ENQ>   │  p, P  <DLE>   │  [     <ESC> │
410                      │f, F  <ACK>   │  q, Q  <DC1>   │  \     <FS>  │
411                      │g, G  <BEL>   │  r, R  <DC2>   │  ]     <GS>  │
412                      │h, H  <BS>    │  s, S  <DC3>   │  ^     <RS>  │
413                      │i, I  <HT>    │  t, T  <DC4>   │  _     <US>  │
414                      │j, J  <LF>    │  u, U  <NAK>   │  ?     <DEL> │
415                      │k, K  <VT>    │  v, V  <SYN>   │              │
416                      └──────────────┴────────────────┴──────────────┘
417       min number
418             Set  the  value  of  MIN to number.  MIN is used in non-canonical
419             mode input processing (icanon).
420
421       time number
422             Set the value of TIME to number.  TIME is used  in  non-canonical
423             mode input processing (icanon).
424
425   Combination Modes
426       saved settings
427             Set  the  current  terminal characteristics to the saved settings
428             produced by the −g option.
429
430       evenp or parity
431             Enable parenb and cs7; disable parodd.
432
433       oddp
434             Enable parenb, cs7, and parodd.
435
436       −parity, −evenp, or −oddp
437             Disable parenb, and set cs8.
438
439       raw (−raw or cooked)
440             Enable (disable) raw input and output. Raw mode shall be  equiva‐
441             lent to setting:
442
443                 stty cs8 erase ^− kill ^− intr ^− \
444                     quit ^− eof ^− eol ^− −post −inpck
445
446       nl (−nl)
447             Disable (enable) icrnl.  In addition, −nl unsets inlcr and igncr.
448
449       ek    Reset ERASE and KILL characters back to system defaults.
450
451       sane
452             Reset all modes to some reasonable, unspecified, values.
453

STDIN

455       Although  no input is read from standard input, standard input shall be
456       used to get the current terminal I/O characteristics  and  to  set  new
457       terminal I/O characteristics.
458

INPUT FILES

460       None.
461

ENVIRONMENT VARIABLES

463       The following environment variables shall affect the execution of stty:
464
465       LANG      Provide  a  default  value for the internationalization vari‐
466                 ables that are unset or null. (See the Base Definitions  vol‐
467                 ume  of POSIX.1‐2008, Section 8.2, Internationalization Vari‐
468                 ables for the precedence  of  internationalization  variables
469                 used to determine the values of locale categories.)
470
471       LC_ALL    If  set  to  a non-empty string value, override the values of
472                 all the other internationalization variables.
473
474       LC_CTYPE  This variable determines the locale for the interpretation of
475                 sequences  of  bytes of text data as characters (for example,
476                 single-byte as opposed to multi-byte characters in arguments)
477                 and which characters are in the class print.
478
479       LC_MESSAGES
480                 Determine the locale that should be used to affect the format
481                 and contents  of  diagnostic  messages  written  to  standard
482                 error.
483
484       NLSPATH   Determine the location of message catalogs for the processing
485                 of LC_MESSAGES.
486

ASYNCHRONOUS EVENTS

488       Default.
489

STDOUT

491       If operands are specified, no output shall be produced.
492
493       If the −g option is specified, stty shall write to standard output  the
494       current  settings  in  a  form that can be used as arguments to another
495       instance of stty on the same system.
496
497       If the −a option is specified, all of the information as  described  in
498       the OPERANDS section shall be written to standard output. Unless other‐
499       wise specified, this information shall be written as  <space>-separated
500       tokens in an unspecified format, on one or more lines, with an unspeci‐
501       fied number of tokens per line. Additional information may be written.
502
503       If no options or operands are specified, an unspecified subset  of  the
504       information written for the −a option shall be written.
505
506       If  speed  information  is written as part of the default output, or if
507       the −a option is specified and if the terminal input speed  and  output
508       speed are the same, the speed information shall be written as follows:
509
510           "speed %d baud;", <speed>
511
512       Otherwise, speeds shall be written as:
513
514           "ispeed %d baud; ospeed %d baud;", <ispeed>, <ospeed>
515
516       In locales other than the POSIX locale, the word baud may be changed to
517       something more appropriate in those locales.
518
519       If control characters are written as part of the default output, or  if
520       the −a option is specified, control characters shall be written as:
521
522           "%s = %s;", <control-character name>, <value>
523
524       where <value> is either the character, or some visual representation of
525       the character if it is non-printable, or the string undef if the  char‐
526       acter is disabled.
527

STDERR

529       The standard error shall be used only for diagnostic messages.
530

OUTPUT FILES

532       None.
533

EXTENDED DESCRIPTION

535       None.
536

EXIT STATUS

538       The following exit values shall be returned:
539
540        0    The terminal options were read or set successfully.
541
542       >0    An error occurred.
543

CONSEQUENCES OF ERRORS

545       Default.
546
547       The following sections are informative.
548

APPLICATION USAGE

550       The  −g flag is designed to facilitate the saving and restoring of ter‐
551       minal state from the shell level. For example, a program may:
552
553           saveterm="$(stty −g)"       # save terminal state
554           stty (new settings)         # set new state
555           ...                         # ...
556           stty $saveterm              # restore terminal state
557
558       Since the format is unspecified, the saved value is not portable across
559       systems.
560
561       Since  the  −a  format  is  so loosely specified, scripts that save and
562       restore terminal settings should use the −g option.
563

EXAMPLES

565       None.
566

RATIONALE

568       The original stty description was taken  directly  from  System  V  and
569       reflected the System V terminal driver termio.  It has been modified to
570       correspond to the terminal driver termios.
571
572       Output modes are specified only for XSI-conformant systems. All  imple‐
573       mentations  are  expected to provide stty operands corresponding to all
574       of the output modes they support.
575
576       The stty utility is primarily used to tailor the user interface of  the
577       terminal, such as selecting the preferred ERASE and KILL characters. As
578       an application programming utility,  stty  can  be  used  within  shell
579       scripts to alter the terminal settings for the duration of the script.
580
581       The termios section states that individual disabling of control charac‐
582       ters is possible through the option _POSIX_VDISABLE.  If  enabled,  two
583       conventions  currently  exist  for specifying this: System V uses "^−",
584       and BSD uses undef.  Both are  accepted  by  stty  in  this  volume  of
585       POSIX.1‐2008.  The  other  BSD  convention  of using the letter 'u' was
586       rejected because it conflicts with the actual letter 'u', which  is  an
587       acceptable value for a control character.
588
589       Early  proposals did not specify the mapping of "^c" to control charac‐
590       ters because the control characters were not  specified  in  the  POSIX
591       locale character set description file requirements. The control charac‐
592       ter  set  is  now  specified  in  the  Base   Definitions   volume   of
593       POSIX.1‐2008,  Chapter  3,  Definitions,  so  the historical mapping is
594       specified. Note that although the mapping corresponds to  control-char‐
595       acter  key  assignments on many terminals that use the ISO/IEC 646:1991
596       standard (or ASCII) character encodings, the mapping specified here  is
597       to the control characters, not their keyboard encodings.
598
599       Since  termios  supports  separate speeds for input and output, two new
600       options were added to specify each distinctly.
601
602       Some historical implementations use standard input to get and set  ter‐
603       minal  characteristics;  others use standard output. Since input from a
604       login TTY is usually restricted to the owner while output to a  TTY  is
605       frequently  open to anyone, using standard input provides fewer chances
606       of accidentally (or maliciously)  altering  the  terminal  settings  of
607       other  users. Using standard input also allows stty −a and stty −g out‐
608       put to be redirected for later use. Therefore, usage of standard  input
609       is required by this volume of POSIX.1‐2008.
610

FUTURE DIRECTIONS

612       None.
613

SEE ALSO

615       Chapter 2, Shell Command Language
616
617       The  Base  Definitions  volume  of POSIX.1‐2008, Chapter 8, Environment
618       Variables, Chapter 11, General Terminal Interface, Section 12.2,  Util‐
619       ity Syntax Guidelines, <termios.h>
620
622       Portions  of  this text are reprinted and reproduced in electronic form
623       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
624       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
625       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
626       cal  and  Electronics  Engineers,  Inc  and  The  Open Group.  (This is
627       POSIX.1-2008 with the 2013 Technical Corrigendum  1  applied.)  In  the
628       event of any discrepancy between this version and the original IEEE and
629       The Open Group Standard, the original IEEE and The Open Group  Standard
630       is  the  referee document. The original Standard can be obtained online
631       at http://www.unix.org/online.html .
632
633       Any typographical or formatting errors that appear  in  this  page  are
634       most likely to have been introduced during the conversion of the source
635       files to man page format. To report such errors,  see  https://www.ker
636       nel.org/doc/man-pages/reporting_bugs.html .
637
638
639
640IEEE/The Open Group                  2013                             STTY(1P)
Impressum