| @@ -1,611 +1,611 @@ | | | @@ -1,611 +1,611 @@ |
1 | .\" $NetBSD: stty.1,v 1.37 2009/12/14 02:34:52 dholland Exp $ | | 1 | .\" $NetBSD: stty.1,v 1.38 2009/12/14 07:35:44 wiz Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 1990, 1993, 1994 | | 3 | .\" Copyright (c) 1990, 1993, 1994 |
4 | .\" The Regents of the University of California. All rights reserved. | | 4 | .\" The Regents of the University of California. All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" This code is derived from software contributed to Berkeley by | | 6 | .\" This code is derived from software contributed to Berkeley by |
7 | .\" the Institute of Electrical and Electronics Engineers, Inc. | | 7 | .\" the Institute of Electrical and Electronics Engineers, Inc. |
8 | .\" | | 8 | .\" |
9 | .\" Redistribution and use in source and binary forms, with or without | | 9 | .\" Redistribution and use in source and binary forms, with or without |
10 | .\" modification, are permitted provided that the following conditions | | 10 | .\" modification, are permitted provided that the following conditions |
11 | .\" are met: | | 11 | .\" are met: |
12 | .\" 1. Redistributions of source code must retain the above copyright | | 12 | .\" 1. Redistributions of source code must retain the above copyright |
13 | .\" notice, this list of conditions and the following disclaimer. | | 13 | .\" notice, this list of conditions and the following disclaimer. |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright |
15 | .\" notice, this list of conditions and the following disclaimer in the | | 15 | .\" notice, this list of conditions and the following disclaimer in the |
16 | .\" documentation and/or other materials provided with the distribution. | | 16 | .\" documentation and/or other materials provided with the distribution. |
17 | .\" 3. Neither the name of the University nor the names of its contributors | | 17 | .\" 3. Neither the name of the University nor the names of its contributors |
18 | .\" may be used to endorse or promote products derived from this software | | 18 | .\" may be used to endorse or promote products derived from this software |
19 | .\" without specific prior written permission. | | 19 | .\" without specific prior written permission. |
20 | .\" | | 20 | .\" |
21 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | | 21 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
22 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 22 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
23 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 23 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
24 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 24 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
25 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 25 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
26 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 26 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
27 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 27 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
28 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 28 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
29 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 29 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
30 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 30 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
31 | .\" SUCH DAMAGE. | | 31 | .\" SUCH DAMAGE. |
32 | .\" | | 32 | .\" |
33 | .\" @(#)stty.1 8.5 (Berkeley) 6/1/94 | | 33 | .\" @(#)stty.1 8.5 (Berkeley) 6/1/94 |
34 | .\" | | 34 | .\" |
35 | .Dd June 24, 2007 | | 35 | .Dd December 14, 2009 |
36 | .Dt STTY 1 | | 36 | .Dt STTY 1 |
37 | .Os | | 37 | .Os |
38 | .Sh NAME | | 38 | .Sh NAME |
39 | .Nm stty | | 39 | .Nm stty |
40 | .Nd set the options for a terminal device interface | | 40 | .Nd set the options for a terminal device interface |
41 | .Sh SYNOPSIS | | 41 | .Sh SYNOPSIS |
42 | .Nm | | 42 | .Nm |
43 | .Op Fl a | Fl e | Fl g | | 43 | .Op Fl a | Fl e | Fl g |
44 | .Op Fl f Ar file | | 44 | .Op Fl f Ar file |
45 | .Op operands | | 45 | .Op operands |
46 | .Sh DESCRIPTION | | 46 | .Sh DESCRIPTION |
47 | The | | 47 | The |
48 | .Nm | | 48 | .Nm |
49 | utility sets or reports on terminal | | 49 | utility sets or reports on terminal |
50 | characteristics for the device that is its standard input. | | 50 | characteristics for the device that is its standard input. |
51 | If no options or operands are specified, it reports the settings of a subset | | 51 | If no options or operands are specified, it reports the settings of a subset |
52 | of characteristics as well as additional ones if they differ from their | | 52 | of characteristics as well as additional ones if they differ from their |
53 | default values. | | 53 | default values. |
54 | Otherwise it modifies | | 54 | Otherwise it modifies |
55 | the terminal state according to the specified arguments. | | 55 | the terminal state according to the specified arguments. |
56 | Some combinations of arguments are mutually | | 56 | Some combinations of arguments are mutually |
57 | exclusive on some terminal types. | | 57 | exclusive on some terminal types. |
58 | .Pp | | 58 | .Pp |
59 | The following options are available: | | 59 | The following options are available: |
60 | .Bl -tag -width Ds | | 60 | .Bl -tag -width Ds |
61 | .It Fl a | | 61 | .It Fl a |
62 | Display all the current settings for the terminal to standard output | | 62 | Display all the current settings for the terminal to standard output |
63 | as per | | 63 | as per |
64 | .St -p1003.2 . | | 64 | .St -p1003.2 . |
65 | .It Fl e | | 65 | .It Fl e |
66 | Display all the current settings for the terminal to standard output | | 66 | Display all the current settings for the terminal to standard output |
67 | in the traditional | | 67 | in the traditional |
68 | .Bx | | 68 | .Bx |
69 | ``all'' and ``everything'' formats. | | 69 | ``all'' and ``everything'' formats. |
70 | .It Fl f | | 70 | .It Fl f |
71 | Open and use the terminal named by | | 71 | Open and use the terminal named by |
72 | .Ar file | | 72 | .Ar file |
73 | rather than using standard input. | | 73 | rather than using standard input. |
74 | The file is opened using the | | 74 | The file is opened using the |
75 | .Dv O_NONBLOCK | | 75 | .Dv O_NONBLOCK |
76 | flag of | | 76 | flag of |
77 | .Fn open , | | 77 | .Fn open , |
78 | making it possible to | | 78 | making it possible to |
79 | set or display settings on a terminal that might otherwise | | 79 | set or display settings on a terminal that might otherwise |
80 | block on the open. | | 80 | block on the open. |
81 | .It Fl g | | 81 | .It Fl g |
82 | Display all the current settings for the terminal to standard output | | 82 | Display all the current settings for the terminal to standard output |
83 | in a form that may be used as an argument to a subsequent invocation of | | 83 | in a form that may be used as an argument to a subsequent invocation of |
84 | .Nm | | 84 | .Nm |
85 | to restore the current terminal state as per | | 85 | to restore the current terminal state as per |
86 | .St -p1003.2 . | | 86 | .St -p1003.2 . |
87 | .El | | 87 | .El |
88 | .Pp | | 88 | .Pp |
89 | The following arguments are available to set the terminal | | 89 | The following arguments are available to set the terminal |
90 | characteristics: | | 90 | characteristics: |
91 | .Ss Control Modes | | 91 | .Ss Control Modes |
92 | Control mode flags affect hardware characteristics associated with the | | 92 | Control mode flags affect hardware characteristics associated with the |
93 | terminal. | | 93 | terminal. |
94 | This corresponds to the c_cflag in the termios structure. | | 94 | This corresponds to the c_cflag in the termios structure. |
95 | .Bl -tag -width Fl | | 95 | .Bl -tag -width Fl |
96 | .It Cm parenb Pq Fl parenb | | 96 | .It Cm parenb Pq Fl parenb |
97 | Enable (disable) parity generation | | 97 | Enable (disable) parity generation |
98 | and detection. | | 98 | and detection. |
99 | .It Cm parodd Pq Fl parodd | | 99 | .It Cm parodd Pq Fl parodd |
100 | Select odd (even) parity. | | 100 | Select odd (even) parity. |
101 | .It Cm cs5 cs6 cs7 cs8 | | 101 | .It Cm cs5 cs6 cs7 cs8 |
102 | Select character size, if possible. | | 102 | Select character size, if possible. |
103 | .It Ar number | | 103 | .It Ar number |
104 | Set terminal baud rate to the | | 104 | Set terminal baud rate to the |
105 | number given, if possible. | | 105 | number given, if possible. |
106 | If the | | 106 | If the |
107 | baud rate is set to zero, modem | | 107 | baud rate is set to zero, modem |
108 | control is no longer | | 108 | control is no longer |
109 | asserted. | | 109 | asserted. |
110 | .It Cm ispeed Ar number | | 110 | .It Cm ispeed Ar number |
111 | Set terminal input baud rate to the | | 111 | Set terminal input baud rate to the |
112 | number given, if possible. | | 112 | number given, if possible. |
113 | If the | | 113 | If the |
114 | input baud rate is set to zero, the | | 114 | input baud rate is set to zero, the |
115 | input baud rate is set to the | | 115 | input baud rate is set to the |
116 | value of the output baud | | 116 | value of the output baud |
117 | rate. | | 117 | rate. |
118 | .It Cm ospeed Ar number | | 118 | .It Cm ospeed Ar number |
119 | Set terminal output baud rate to | | 119 | Set terminal output baud rate to |
120 | the number given, if possible. | | 120 | the number given, if possible. |
121 | If | | 121 | If |
122 | the output baud rate is set to | | 122 | the output baud rate is set to |
123 | zero, modem control is | | 123 | zero, modem control is |
124 | no longer asserted. | | 124 | no longer asserted. |
125 | .It Cm speed Ar number | | 125 | .It Cm speed Ar number |
126 | This sets both | | 126 | This sets both |
127 | .Cm ispeed | | 127 | .Cm ispeed |
128 | and | | 128 | and |
129 | .Cm ospeed | | 129 | .Cm ospeed |
130 | to | | 130 | to |
131 | .Ar number . | | 131 | .Ar number . |
132 | .It Cm hupcl Pq Fl hupcl | | 132 | .It Cm hupcl Pq Fl hupcl |
133 | Stop asserting modem control | | 133 | Stop asserting modem control |
134 | (do not stop asserting modem control) on last close. | | 134 | (do not stop asserting modem control) on last close. |
135 | .It Cm hup Pq Fl hup | | 135 | .It Cm hup Pq Fl hup |
136 | Same as hupcl | | 136 | Same as hupcl |
137 | .Pq Fl hupcl . | | 137 | .Pq Fl hupcl . |
138 | .It Cm cstopb Pq Fl cstopb | | 138 | .It Cm cstopb Pq Fl cstopb |
139 | Use two (one) stop bits per character. | | 139 | Use two (one) stop bits per character. |
140 | .It Cm cread Pq Fl cread | | 140 | .It Cm cread Pq Fl cread |
141 | Enable (disable) the receiver. | | 141 | Enable (disable) the receiver. |
142 | .It Cm clocal Pq Fl clocal | | 142 | .It Cm clocal Pq Fl clocal |
143 | Assume a line without (with) modem | | 143 | Assume a line without (with) modem |
144 | control. | | 144 | control. |
145 | .It Cm crtscts Pq Fl crtscts | | 145 | .It Cm crtscts Pq Fl crtscts |
146 | Enable RTS/CTS flow control. | | 146 | Enable RTS/CTS flow control. |
147 | .It Cm cdtrcts Pq Fl cdtrcts | | 147 | .It Cm cdtrcts Pq Fl cdtrcts |
148 | Enable DTR/CTS flow control (if supported). | | 148 | Enable DTR/CTS flow control (if supported). |
149 | .El | | 149 | .El |
150 | .Ss Input Modes | | 150 | .Ss Input Modes |
151 | This corresponds to the c_iflag in the termios structure. | | 151 | This corresponds to the c_iflag in the termios structure. |
152 | .Bl -tag -width Fl | | 152 | .Bl -tag -width Fl |
153 | .It Cm ignbrk Pq Fl ignbrk | | 153 | .It Cm ignbrk Pq Fl ignbrk |
154 | Ignore (do not ignore) break on | | 154 | Ignore (do not ignore) break on |
155 | input. | | 155 | input. |
156 | .It Cm brkint Pq Fl brkint | | 156 | .It Cm brkint Pq Fl brkint |
157 | Signal (do not signal) | | 157 | Signal (do not signal) |
158 | .Dv INTR | | 158 | .Dv INTR |
159 | on | | 159 | on |
160 | break. | | 160 | break. |
161 | .It Cm ignpar Pq Fl ignpar | | 161 | .It Cm ignpar Pq Fl ignpar |
162 | Ignore (do not ignore) parity | | 162 | Ignore (do not ignore) parity |
163 | errors. | | 163 | errors. |
164 | .It Cm parmrk Pq Fl parmrk | | 164 | .It Cm parmrk Pq Fl parmrk |
165 | Mark (do not mark) parity errors. | | 165 | Mark (do not mark) parity errors. |
166 | .It Cm inpck Pq Fl inpck | | 166 | .It Cm inpck Pq Fl inpck |
167 | Enable (disable) input parity | | 167 | Enable (disable) input parity |
168 | checking. | | 168 | checking. |
169 | .It Cm istrip Pq Fl istrip | | 169 | .It Cm istrip Pq Fl istrip |
170 | Strip (do not strip) input characters | | 170 | Strip (do not strip) input characters |
171 | to seven bits. | | 171 | to seven bits. |
172 | .It Cm inlcr Pq Fl inlcr | | 172 | .It Cm inlcr Pq Fl inlcr |
173 | Map (do not map) | | 173 | Map (do not map) |
174 | .Dv NL | | 174 | .Dv NL |
175 | to | | 175 | to |
176 | .Dv CR | | 176 | .Dv CR |
177 | on input. | | 177 | on input. |
178 | .It Cm igncr Pq Fl igncr | | 178 | .It Cm igncr Pq Fl igncr |
179 | Ignore (do not ignore) | | 179 | Ignore (do not ignore) |
180 | .Dv CR | | 180 | .Dv CR |
181 | on input. | | 181 | on input. |
182 | .It Cm icrnl Pq Fl icrnl | | 182 | .It Cm icrnl Pq Fl icrnl |
183 | Map (do not map) | | 183 | Map (do not map) |
184 | .Dv CR | | 184 | .Dv CR |
185 | to | | 185 | to |
186 | .Dv NL | | 186 | .Dv NL |
187 | on input. | | 187 | on input. |
188 | .It Cm ixon Pq Fl ixon | | 188 | .It Cm ixon Pq Fl ixon |
189 | Enable (disable) | | 189 | Enable (disable) |
190 | .Dv START/STOP | | 190 | .Dv START/STOP |
191 | output | | 191 | output |
192 | control. | | 192 | control. |
193 | Output from the system is | | 193 | Output from the system is |
194 | stopped when the system receives | | 194 | stopped when the system receives |
195 | .Dv STOP | | 195 | .Dv STOP |
196 | and started when the system | | 196 | and started when the system |
197 | receives | | 197 | receives |
198 | .Dv START , | | 198 | .Dv START , |
199 | or if | | 199 | or if |
200 | .Cm ixany | | 200 | .Cm ixany |
201 | is set, any character restarts output. | | 201 | is set, any character restarts output. |
202 | .It Cm ixoff Pq Fl ixoff | | 202 | .It Cm ixoff Pq Fl ixoff |
203 | Request that the system send (not | | 203 | Request that the system send (not |
204 | send) | | 204 | send) |
205 | .Dv START/STOP | | 205 | .Dv START/STOP |
206 | characters when | | 206 | characters when |
207 | the input queue is nearly | | 207 | the input queue is nearly |
208 | empty/full. | | 208 | empty/full. |
209 | .It Cm ixany Pq Fl ixany | | 209 | .It Cm ixany Pq Fl ixany |
210 | Allow any character (allow only | | 210 | Allow any character (allow only |
211 | .Dv START ) | | 211 | .Dv START ) |
212 | to restart output. | | 212 | to restart output. |
213 | .It Cm imaxbel Pq Fl imaxbel | | 213 | .It Cm imaxbel Pq Fl imaxbel |
214 | The system imposes a limit of | | 214 | The system imposes a limit of |
215 | .Dv MAX_INPUT | | 215 | .Dv MAX_INPUT |
216 | (currently 255) characters in the input queue. | | 216 | (currently 255) characters in the input queue. |
217 | If | | 217 | If |
218 | .Cm imaxbel | | 218 | .Cm imaxbel |
219 | is set and the input queue limit has been reached, | | 219 | is set and the input queue limit has been reached, |
220 | subsequent input causes the system to send an ASCII BEL | | 220 | subsequent input causes the system to send an ASCII BEL |
221 | character to the output queue (the terminal beeps at you). | | 221 | character to the output queue (the terminal beeps at you). |
222 | Otherwise, | | 222 | Otherwise, |
223 | if | | 223 | if |
224 | .Cm imaxbel | | 224 | .Cm imaxbel |
225 | is unset and the input queue is full, the next input character causes | | 225 | is unset and the input queue is full, the next input character causes |
226 | the entire input and output queues to be discarded. | | 226 | the entire input and output queues to be discarded. |
227 | .El | | 227 | .El |
228 | .Ss Output Modes | | 228 | .Ss Output Modes |
229 | This corresponds to the c_oflag of the termios structure. | | 229 | This corresponds to the c_oflag of the termios structure. |
230 | .Bl -tag -width Fl | | 230 | .Bl -tag -width Fl |
231 | .It Cm opost Pq Fl opost | | 231 | .It Cm opost Pq Fl opost |
232 | Post-process output (do not | | 232 | Post-process output (do not |
233 | post-process output; ignore all other | | 233 | post-process output; ignore all other |
234 | output modes). | | 234 | output modes). |
235 | .It Cm onlcr Pq Fl onlcr | | 235 | .It Cm onlcr Pq Fl onlcr |
236 | Map (do not map) | | 236 | Map (do not map) |
237 | .Dv NL | | 237 | .Dv NL |
238 | to | | 238 | to |
239 | .Dv CR-NL | | 239 | .Dv CR-NL |
240 | on output. | | 240 | on output. |
241 | .It Cm ocrnl Pq Fl ocrnl | | 241 | .It Cm ocrnl Pq Fl ocrnl |
242 | Map (do not map) | | 242 | Map (do not map) |
243 | .Dv CR | | 243 | .Dv CR |
244 | to | | 244 | to |
245 | .Dv NL | | 245 | .Dv NL |
246 | on output. | | 246 | on output. |
247 | .It Cm oxtabs Pq Fl oxtabs | | 247 | .It Cm oxtabs Pq Fl oxtabs |
248 | Expand (do not expand) tabs to spaces on output. | | 248 | Expand (do not expand) tabs to spaces on output. |
249 | .It Cm onocr Pq Fl onocr | | 249 | .It Cm onocr Pq Fl onocr |
250 | Do not (do) output CRs at column zero. | | 250 | Do not (do) output CRs at column zero. |
251 | .It Cm onlret Pq Fl onlret | | 251 | .It Cm onlret Pq Fl onlret |
252 | On the terminal NL performs (does not perform) the CR function. | | 252 | On the terminal NL performs (does not perform) the CR function. |
253 | .El | | 253 | .El |
254 | .Ss Local Modes | | 254 | .Ss Local Modes |
255 | Local mode flags (lflags) affect various and sundry characteristics of terminal | | 255 | Local mode flags (lflags) affect various and sundry characteristics of terminal |
256 | processing. | | 256 | processing. |
257 | Historically the term "local" pertained to new job control features | | 257 | Historically the term "local" pertained to new job control features |
258 | implemented by Jim Kulp on a | | 258 | implemented by Jim Kulp on a |
259 | .Tn PDP Ns -11/70 | | 259 | .Tn PDP Ns -11/70 |
260 | at | | 260 | at |
261 | .Tn IIASA . | | 261 | .Tn IIASA . |
262 | Later the driver ran on the first | | 262 | Later the driver ran on the first |
263 | .Tn VAX | | 263 | .Tn VAX |
264 | at Evans Hall, UC Berkeley, where the job control details | | 264 | at Evans Hall, UC Berkeley, where the job control details |
265 | were greatly modified but the structure definitions and names | | 265 | were greatly modified but the structure definitions and names |
266 | remained essentially unchanged. | | 266 | remained essentially unchanged. |
267 | The second interpretation of the 'l' in lflag | | 267 | The second interpretation of the 'l' in lflag |
268 | is ``line discipline flag'' which corresponds to the | | 268 | is ``line discipline flag'' which corresponds to the |
269 | .Ar c_lflag | | 269 | .Ar c_lflag |
270 | of the | | 270 | of the |
271 | .Ar termios | | 271 | .Ar termios |
272 | structure. | | 272 | structure. |
273 | .Bl -tag -width Fl | | 273 | .Bl -tag -width Fl |
274 | .It Cm isig Pq Fl isig | | 274 | .It Cm isig Pq Fl isig |
275 | Enable (disable) the checking of | | 275 | Enable (disable) the checking of |
276 | characters against the special control | | 276 | characters against the special control |
277 | characters | | 277 | characters |
278 | .Dv INTR , QUIT , | | 278 | .Dv INTR , QUIT , |
279 | and | | 279 | and |
280 | .Dv SUSP . | | 280 | .Dv SUSP . |
281 | .It Cm icanon Pq Fl icanon | | 281 | .It Cm icanon Pq Fl icanon |
282 | Enable (disable) canonical input | | 282 | Enable (disable) canonical input |
283 | .Pf ( Dv ERASE | | 283 | .Pf ( Dv ERASE |
284 | and | | 284 | and |
285 | .Dv KILL | | 285 | .Dv KILL |
286 | processing). | | 286 | processing). |
287 | .It Cm iexten Pq Fl iexten | | 287 | .It Cm iexten Pq Fl iexten |
288 | Enable (disable) any implementation | | 288 | Enable (disable) any implementation |
289 | defined special control characters | | 289 | defined special control characters |
290 | not currently controlled by icanon, | | 290 | not currently controlled by icanon, |
291 | isig, or ixon. | | 291 | isig, or ixon. |
292 | .It Cm echo Pq Fl echo | | 292 | .It Cm echo Pq Fl echo |
293 | Echo back (do not echo back) every | | 293 | Echo back (do not echo back) every |
294 | character typed. | | 294 | character typed. |
295 | .It Cm echoe Pq Fl echoe | | 295 | .It Cm echoe Pq Fl echoe |
296 | The | | 296 | The |
297 | .Dv ERASE | | 297 | .Dv ERASE |
298 | character shall (shall | | 298 | character shall (shall |
299 | not) visually erase the last character | | 299 | not) visually erase the last character |
300 | in the current line from the | | 300 | in the current line from the |
301 | display, if possible. | | 301 | display, if possible. |
302 | .It Cm echok Pq Fl echok | | 302 | .It Cm echok Pq Fl echok |
303 | Echo (do not echo) | | 303 | Echo (do not echo) |
304 | .Dv NL | | 304 | .Dv NL |
305 | after | | 305 | after |
306 | .Dv KILL | | 306 | .Dv KILL |
307 | character. | | 307 | character. |
308 | .It Cm echoke Pq Fl echoke | | 308 | .It Cm echoke Pq Fl echoke |
309 | The | | 309 | The |
310 | .Dv KILL | | 310 | .Dv KILL |
311 | character shall (shall | | 311 | character shall (shall |
312 | not) visually erase | | 312 | not) visually erase |
313 | the current line from the | | 313 | the current line from the |
314 | display, if possible. | | 314 | display, if possible. |
315 | .It Cm echonl Pq Fl echonl | | 315 | .It Cm echonl Pq Fl echonl |
316 | Echo (do not echo) | | 316 | Echo (do not echo) |
317 | .Dv NL , | | 317 | .Dv NL , |
318 | even if echo | | 318 | even if echo |
319 | is disabled. | | 319 | is disabled. |
320 | .It Cm echoctl Pq Fl echoctl | | 320 | .It Cm echoctl Pq Fl echoctl |
321 | If | | 321 | If |
322 | .Cm echoctl | | 322 | .Cm echoctl |
323 | is set, echo control characters as ^X. | | 323 | is set, echo control characters as ^X. |
324 | Otherwise control characters echo as themselves. | | 324 | Otherwise control characters echo as themselves. |
325 | .It Cm echoprt Pq Fl echoprt | | 325 | .It Cm echoprt Pq Fl echoprt |
326 | For printing terminals. | | 326 | For printing terminals. |
327 | If set, echo erased characters backwards within ``\\'' | | 327 | If set, echo erased characters backwards within ``\\'' |
328 | and ``/''. | | 328 | and ``/''. |
329 | Otherwise, disable this feature. | | 329 | Otherwise, disable this feature. |
330 | .It Cm noflsh Pq Fl noflsh | | 330 | .It Cm noflsh Pq Fl noflsh |
331 | Disable (enable) flush after | | 331 | Disable (enable) flush after |
332 | .Dv INTR , QUIT , SUSP . | | 332 | .Dv INTR , QUIT , SUSP . |
333 | .It Cm tostop Pq Fl tostop | | 333 | .It Cm tostop Pq Fl tostop |
334 | Send (do not send) | | 334 | Send (do not send) |
335 | .Dv SIGTTOU | | 335 | .Dv SIGTTOU |
336 | for background output. | | 336 | for background output. |
337 | This causes background jobs to stop if they attempt terminal output. | | 337 | This causes background jobs to stop if they attempt terminal output. |
338 | .It Cm altwerase Pq Fl altwerase | | 338 | .It Cm altwerase Pq Fl altwerase |
339 | Use (do not use) an alternative word erase algorithm when processing | | 339 | Use (do not use) an alternative word erase algorithm when processing |
340 | .Dv WERASE | | 340 | .Dv WERASE |
341 | characters. | | 341 | characters. |
342 | This alternative algorithm considers sequences of | | 342 | This alternative algorithm considers sequences of |
343 | alphanumeric/underscores as words. | | 343 | alphanumeric/underscores as words. |
344 | It also skips the first preceding character in its classification | | 344 | It also skips the first preceding character in its classification |
345 | (as a convenience since the one preceding character could have been | | 345 | (as a convenience since the one preceding character could have been |
346 | erased with simply an | | 346 | erased with simply an |
347 | .Dv ERASE | | 347 | .Dv ERASE |
348 | character.) | | 348 | character.) |
349 | .It Cm mdmbuf Pq Fl mdmbuf | | 349 | .It Cm mdmbuf Pq Fl mdmbuf |
350 | If set, flow control output based on condition of Carrier Detect. | | 350 | If set, flow control output based on condition of Carrier Detect. |
351 | Otherwise writes return an error if Carrier Detect is low (and Carrier | | 351 | Otherwise writes return an error if Carrier Detect is low (and Carrier |
352 | is not being ignored with the | | 352 | is not being ignored with the |
353 | .Dv CLOCAL | | 353 | .Dv CLOCAL |
354 | flag.) | | 354 | flag.) |
355 | .It Cm flusho Pq Fl flusho | | 355 | .It Cm flusho Pq Fl flusho |
356 | Indicates output is (is not) being discarded. | | 356 | Indicates output is (is not) being discarded. |
357 | .It Cm pendin Pq Fl pendin | | 357 | .It Cm pendin Pq Fl pendin |
358 | Indicates input is (is not) pending after a switch from non-canonical | | 358 | Indicates input is (is not) pending after a switch from non-canonical |
359 | to canonical mode and will be re-input when a read becomes pending | | 359 | to canonical mode and will be re-input when a read becomes pending |
360 | or more input arrives. | | 360 | or more input arrives. |
361 | .El | | 361 | .El |
362 | .Ss Control Characters | | 362 | .Ss Control Characters |
363 | .Bl -tag -width Fl | | 363 | .Bl -tag -width Fl |
364 | .It Ar control-character Ar string | | 364 | .It Ar control-character Ar string |
365 | Set | | 365 | Set |
366 | .Ar control-character | | 366 | .Ar control-character |
367 | to | | 367 | to |
368 | .Ar string . | | 368 | .Ar string . |
369 | If string is a single character, | | 369 | If string is a single character, |
370 | the control character is set to | | 370 | the control character is set to |
371 | that character. | | 371 | that character. |
372 | If string is the | | 372 | If string is the |
373 | two character sequence "^-" or the | | 373 | two character sequence "^-" or the |
374 | string "undef" the control character | | 374 | string "undef" the control character |
375 | is disabled (i.e. set to | | 375 | is disabled (i.e. set to |
376 | .Bro Dv _POSIX_VDISABLE Brc . ) | | 376 | .Bro Dv _POSIX_VDISABLE Brc . ) |
377 | .Pp | | 377 | .Pp |
378 | Recognized control-characters: | | 378 | Recognized control-characters: |
379 | .Bd -ragged -offset indent | | 379 | .Bd -ragged -offset indent |
380 | .Bl -column character Subscript Description | | 380 | .Bl -column character Subscript Description |
381 | .It control- Ta "" Ta "" | | 381 | .It control- Ta "" Ta "" |
382 | .It character Subscript Description | | 382 | .It character Subscript Description |
383 | .It _________ _________ _______________ | | 383 | .It _________ _________ _______________ |
384 | .It eof Ta Tn VEOF Ta EOF No character | | 384 | .It eof Ta Tn VEOF Ta EOF No character |
385 | .It eol Ta Tn VEOL Ta EOL No character | | 385 | .It eol Ta Tn VEOL Ta EOL No character |
386 | .It eol2 Ta Tn VEOL2 Ta EOL2 No character | | 386 | .It eol2 Ta Tn VEOL2 Ta EOL2 No character |
387 | .It erase Ta Tn VERASE Ta ERASE No character | | 387 | .It erase Ta Tn VERASE Ta ERASE No character |
388 | .It werase Ta Tn VWERASE Ta WERASE No character | | 388 | .It werase Ta Tn VWERASE Ta WERASE No character |
389 | .It kill Ta Tn VKILL Ta KILL No character | | 389 | .It kill Ta Tn VKILL Ta KILL No character |
390 | .It reprint Ta Tn VREPRINT Ta REPRINT No character | | 390 | .It reprint Ta Tn VREPRINT Ta REPRINT No character |
391 | .It intr Ta Tn VINTR Ta INTR No character | | 391 | .It intr Ta Tn VINTR Ta INTR No character |
392 | .It quit Ta Tn VQUIT Ta QUIT No character | | 392 | .It quit Ta Tn VQUIT Ta QUIT No character |
393 | .It susp Ta Tn VSUSP Ta SUSP No character | | 393 | .It susp Ta Tn VSUSP Ta SUSP No character |
394 | .It dsusp Ta Tn VDSUSP Ta DSUSP No character | | 394 | .It dsusp Ta Tn VDSUSP Ta DSUSP No character |
395 | .It start Ta Tn VSTART Ta START No character | | 395 | .It start Ta Tn VSTART Ta START No character |
396 | .It stop Ta Tn VSTOP Ta STOP No character | | 396 | .It stop Ta Tn VSTOP Ta STOP No character |
397 | .It lnext Ta Tn VLNEXT Ta LNEXT No character | | 397 | .It lnext Ta Tn VLNEXT Ta LNEXT No character |
398 | .It status Ta Tn VSTATUS Ta STATUS No character | | 398 | .It status Ta Tn VSTATUS Ta STATUS No character |
399 | .It discard Ta Tn VDISCARD Ta DISCARD No character | | 399 | .It discard Ta Tn VDISCARD Ta DISCARD No character |
400 | .El | | 400 | .El |
401 | .Ed | | 401 | .Ed |
402 | .It Cm min Ar number | | 402 | .It Cm min Ar number |
403 | .It Cm time Ar number | | 403 | .It Cm time Ar number |
404 | Set the value of min or time to | | 404 | Set the value of min or time to |
405 | number. | | 405 | number. |
406 | .Dv MIN | | 406 | .Dv MIN |
407 | and | | 407 | and |
408 | .Dv TIME | | 408 | .Dv TIME |
409 | are used in | | 409 | are used in |
410 | Non-Canonical mode input processing | | 410 | Non-Canonical mode input processing |
411 | (-icanon). | | 411 | (-icanon). |
412 | .El | | 412 | .El |
413 | .Ss Combination Modes | | 413 | .Ss Combination Modes |
414 | .Bl -tag -width Fl | | 414 | .Bl -tag -width Fl |
415 | .It Ar saved settings | | 415 | .It Ar saved settings |
416 | Set the current terminal characteristics to the saved settings | | 416 | Set the current terminal characteristics to the saved settings |
417 | produced by the | | 417 | produced by the |
418 | .Fl g | | 418 | .Fl g |
419 | option. | | 419 | option. |
420 | .It Cm evenp No or Cm parity | | 420 | .It Cm evenp No or Cm parity |
421 | Enable parenb and cs7; disable parodd. | | 421 | Enable parenb and cs7; disable parodd. |
422 | .It Cm oddp | | 422 | .It Cm oddp |
423 | Enable parenb, cs7, and parodd. | | 423 | Enable parenb, cs7, and parodd. |
424 | .It Fl parity , evenp , oddp | | 424 | .It Fl parity , evenp , oddp |
425 | Disable parenb, and set cs8. | | 425 | Disable parenb, and set cs8. |
426 | .It Cm \&nl Pq Fl \&nl | | 426 | .It Cm \&nl Pq Fl \&nl |
427 | Enable (disable) icrnl. | | 427 | Enable (disable) icrnl. |
428 | In addition | | 428 | In addition |
429 | -nl unsets inlcr and igncr. | | 429 | -nl unsets inlcr and igncr. |
430 | .It Cm ek | | 430 | .It Cm ek |
431 | Reset | | 431 | Reset |
432 | .Dv ERASE | | 432 | .Dv ERASE |
433 | and | | 433 | and |
434 | .Dv KILL | | 434 | .Dv KILL |
435 | characters back to system defaults. | | 435 | characters back to system defaults. |
436 | .It Cm sane | | 436 | .It Cm sane |
437 | Resets all modes to reasonable values for interactive terminal use. | | 437 | Resets all modes to reasonable values for interactive terminal use. |
438 | .It Cm insane | | 438 | .It Cm insane |
439 | Sets all modes to random values, which are very likely | | 439 | Sets all modes to random values, which are very likely |
440 | .Pq but not guaranteed | | 440 | .Pq but not guaranteed |
441 | to be unreasonable for interactive terminal use. | | 441 | to be unreasonable for interactive terminal use. |
442 | .It Cm tty | | 442 | .It Cm tty |
443 | Set the line discipline to the standard terminal line discipline | | 443 | Set the line discipline to the standard terminal line discipline |
444 | .Dv TTYDISC . | | 444 | .Dv TTYDISC . |
445 | .It Cm crt Pq Fl crt | | 445 | .It Cm crt Pq Fl crt |
446 | Set (disable) all modes suitable for a CRT display device. | | 446 | Set (disable) all modes suitable for a CRT display device. |
447 | .It Cm kerninfo Pq Fl kerninfo | | 447 | .It Cm kerninfo Pq Fl kerninfo |
448 | Enable (disable) the system generated status line associated with | | 448 | Enable (disable) the system generated status line associated with |
449 | processing a | | 449 | processing a |
450 | .Dv STATUS | | 450 | .Dv STATUS |
451 | character (usually set to ^T). | | 451 | character (usually set to ^T). |
452 | The status line consists of the | | 452 | The status line consists of the |
453 | system load average, the current command name, its process ID, the | | 453 | system load average, the current command name, its process ID, the |
454 | event the process is waiting on (or the status of the process), the user | | 454 | event the process is waiting on (or the status of the process), the user |
455 | and system times, percent CPU, and current memory usage. | | 455 | and system times, percent CPU, and current memory usage. |
456 | .It Cm columns Ar number | | 456 | .It Cm columns Ar number |
457 | The terminal size is recorded as having | | 457 | The terminal size is recorded as having |
458 | .Ar number | | 458 | .Ar number |
459 | columns. | | 459 | columns. |
460 | .It Cm cols Ar number | | 460 | .It Cm cols Ar number |
461 | is an alias for | | 461 | is an alias for |
462 | .Cm columns . | | 462 | .Cm columns . |
463 | .It Cm rows Ar number | | 463 | .It Cm rows Ar number |
464 | The terminal size is recorded as having | | 464 | The terminal size is recorded as having |
465 | .Ar number | | 465 | .Ar number |
466 | rows. | | 466 | rows. |
467 | .It Cm dec | | 467 | .It Cm dec |
468 | Set modes suitable for users of Digital Equipment Corporation systems ( | | 468 | Set modes suitable for users of Digital Equipment Corporation systems ( |
469 | .Dv ERASE , | | 469 | .Dv ERASE , |
470 | .Dv KILL , | | 470 | .Dv KILL , |
471 | and | | 471 | and |
472 | .Dv INTR | | 472 | .Dv INTR |
473 | characters are set to ^?, ^U, and ^C; | | 473 | characters are set to ^?, ^U, and ^C; |
474 | .Dv ixany | | 474 | .Dv ixany |
475 | is disabled, and | | 475 | is disabled, and |
476 | .Dv crt | | 476 | .Dv crt |
477 | is enabled.) | | 477 | is enabled.) |
478 | .It Cm extproc Pq Fl extproc | | 478 | .It Cm extproc Pq Fl extproc |
479 | If set, this flag indicates that some amount of terminal processing is being | | 479 | If set, this flag indicates that some amount of terminal processing is being |
480 | performed by either the terminal hardware or by the remote side connected | | 480 | performed by either the terminal hardware or by the remote side connected |
481 | to a pty. | | 481 | to a pty. |
482 | .It Cm raw Pq Fl raw | | 482 | .It Cm raw Pq Fl raw |
483 | If set, change the modes of the terminal so that no input or output processing | | 483 | If set, change the modes of the terminal so that no input or output processing |
484 | is performed. | | 484 | is performed. |
485 | If unset, change the modes of the terminal to some reasonable | | 485 | If unset, change the modes of the terminal to some reasonable |
486 | state that performs input and output processing. | | 486 | state that performs input and output processing. |
487 | Note that since the terminal driver no longer has a single | | 487 | Note that since the terminal driver no longer has a single |
488 | .Dv RAW | | 488 | .Dv RAW |
489 | bit, it is not possible to intuit what flags were set prior to setting | | 489 | bit, it is not possible to intuit what flags were set prior to setting |
490 | .Cm raw . | | 490 | .Cm raw . |
491 | This means that unsetting | | 491 | This means that unsetting |
492 | .Cm raw | | 492 | .Cm raw |
493 | may not put back all the setting that were previously in effect. | | 493 | may not put back all the setting that were previously in effect. |
494 | To set the terminal into a raw state and then accurately restore it, the following | | 494 | To set the terminal into a raw state and then accurately restore it, the following |
495 | shell code is recommended: | | 495 | shell code is recommended: |
496 | .Bd -literal -offset indent | | 496 | .Bd -literal -offset indent |
497 | save_state=$(stty -g) | | 497 | save_state=$(stty -g) |
498 | stty raw | | 498 | stty raw |
499 | \&... | | 499 | \&... |
500 | stty "$save_state" | | 500 | stty "$save_state" |
501 | .Ed | | 501 | .Ed |
502 | .It Cm size | | 502 | .It Cm size |
503 | The size of the terminal is printed as two numbers on a single line, | | 503 | The size of the terminal is printed as two numbers on a single line, |
504 | first rows, then columns. | | 504 | first rows, then columns. |
505 | .El | | 505 | .El |
506 | .Ss Compatibility Modes | | 506 | .Ss Compatibility Modes |
507 | These modes remain for compatibility with the previous version of | | 507 | These modes remain for compatibility with the previous version of |
508 | the stty command. | | 508 | the stty command. |
509 | .Bl -tag -width Fl | | 509 | .Bl -tag -width Fl |
510 | .It Cm all | | 510 | .It Cm all |
511 | Reports all the terminal modes as with | | 511 | Reports all the terminal modes as with |
512 | .Cm stty Fl a | | 512 | .Cm stty Fl a |
513 | except that the control characters are printed in a columnar format. | | 513 | except that the control characters are printed in a columnar format. |
514 | .It Cm everything | | 514 | .It Cm everything |
515 | Same as | | 515 | Same as |
516 | .Cm all . | | 516 | .Cm all . |
517 | .It Cm cooked | | 517 | .It Cm cooked |
518 | Same as | | 518 | Same as |
519 | .Cm sane . | | 519 | .Cm sane . |
520 | .It Cm cbreak | | 520 | .It Cm cbreak |
521 | If set, enables | | 521 | If set, enables |
522 | .Cm brkint , ixon , imaxbel , opost , | | 522 | .Cm brkint , ixon , imaxbel , opost , |
523 | .Cm isig , iexten , | | 523 | .Cm isig , iexten , |
524 | and | | 524 | and |
525 | .Fl icanon . | | 525 | .Fl icanon . |
526 | If unset, same as | | 526 | If unset, same as |
527 | .Cm sane . | | 527 | .Cm sane . |
528 | .It Cm new | | 528 | .It Cm new |
529 | Same as | | 529 | Same as |
530 | .Cm tty . | | 530 | .Cm tty . |
531 | .It Cm old | | 531 | .It Cm old |
532 | Same as | | 532 | Same as |
533 | .Cm tty . | | 533 | .Cm tty . |
534 | .It Cm newcrt Pq Fl newcrt | | 534 | .It Cm newcrt Pq Fl newcrt |
535 | Same as | | 535 | Same as |
536 | .Cm crt . | | 536 | .Cm crt . |
537 | .It Cm pass8 | | 537 | .It Cm pass8 |
538 | The converse of | | 538 | The converse of |
539 | .Cm parity . | | 539 | .Cm parity . |
540 | .It Cm tandem Pq Fl tandem | | 540 | .It Cm tandem Pq Fl tandem |
541 | Same as | | 541 | Same as |
542 | .Cm ixoff . | | 542 | .Cm ixoff . |
543 | .It Cm decctlq Pq Fl decctlq | | 543 | .It Cm decctlq Pq Fl decctlq |
544 | The converse of | | 544 | The converse of |
545 | .Cm ixany . | | 545 | .Cm ixany . |
546 | .It Cm crterase Pq Fl crterase | | 546 | .It Cm crterase Pq Fl crterase |
547 | Same as | | 547 | Same as |
548 | .Cm echoe . | | 548 | .Cm echoe . |
549 | .It Cm crtbs Pq Fl crtbs | | 549 | .It Cm crtbs Pq Fl crtbs |
550 | Same as | | 550 | Same as |
551 | .Cm echoe . | | 551 | .Cm echoe . |
552 | .It Cm crtkill Pq Fl crtkill | | 552 | .It Cm crtkill Pq Fl crtkill |
553 | Same as | | 553 | Same as |
554 | .Cm echoke . | | 554 | .Cm echoke . |
555 | .It Cm ctlecho Pq Fl ctlecho | | 555 | .It Cm ctlecho Pq Fl ctlecho |
556 | Same as | | 556 | Same as |
557 | .Cm echoctl . | | 557 | .Cm echoctl . |
558 | .It Cm prterase Pq Fl prterase | | 558 | .It Cm prterase Pq Fl prterase |
559 | Same as | | 559 | Same as |
560 | .Cm echoprt . | | 560 | .Cm echoprt . |
561 | .It Cm litout Pq Fl litout | | 561 | .It Cm litout Pq Fl litout |
562 | The converse of | | 562 | The converse of |
563 | .Cm opost . | | 563 | .Cm opost . |
564 | .It Cm tabs Pq Fl tabs | | 564 | .It Cm tabs Pq Fl tabs |
565 | The converse of | | 565 | The converse of |
566 | .Cm oxtabs . | | 566 | .Cm oxtabs . |
567 | .It Cm brk Ar value | | 567 | .It Cm brk Ar value |
568 | Same as the control character | | 568 | Same as the control character |
569 | .Cm eol . | | 569 | .Cm eol . |
570 | .It Cm flush Ar value | | 570 | .It Cm flush Ar value |
571 | Same as the control character | | 571 | Same as the control character |
572 | .Cm discard . | | 572 | .Cm discard . |
573 | .It Cm rprnt Ar value | | 573 | .It Cm rprnt Ar value |
574 | Same as the control character | | 574 | Same as the control character |
575 | .Cm reprint . | | 575 | .Cm reprint . |
576 | .El | | 576 | .El |
577 | .Ss Control operations | | 577 | .Ss Control operations |
578 | These operations are not modes, but rather commands to be performed by | | 578 | These operations are not modes, but rather commands to be performed by |
579 | the tty layer. | | 579 | the tty layer. |
580 | .Bl -tag -width Fl | | 580 | .Bl -tag -width Fl |
581 | .It Cm ostart | | 581 | .It Cm ostart |
582 | Performs a "start output" operation, as normally done by an | | 582 | Performs a "start output" operation, as normally done by an |
583 | incoming START character when | | 583 | incoming START character when |
584 | .Cm ixon | | 584 | .Cm ixon |
585 | is set. | | 585 | is set. |
586 | .It Cm ostop | | 586 | .It Cm ostop |
587 | Performs a "stop output" operation, as normally done by an | | 587 | Performs a "stop output" operation, as normally done by an |
588 | incoming STOP character when | | 588 | incoming STOP character when |
589 | .Cm ixon | | 589 | .Cm ixon |
590 | is set. | | 590 | is set. |
591 | .El | | 591 | .El |
592 | .Sh EXIT STATUS | | 592 | .Sh EXIT STATUS |
593 | The | | 593 | The |
594 | .Nm | | 594 | .Nm |
595 | utility exits with a value of 0 if successful, and \*[Gt]0 if an error occurs. | | 595 | utility exits with a value of 0 if successful, and \*[Gt]0 if an error occurs. |
596 | .Sh SEE ALSO | | 596 | .Sh SEE ALSO |
597 | .Xr termios 4 , | | 597 | .Xr termios 4 , |
598 | .Xr tty 4 | | 598 | .Xr tty 4 |
599 | .Sh STANDARDS | | 599 | .Sh STANDARDS |
600 | The | | 600 | The |
601 | .Nm | | 601 | .Nm |
602 | utility is expected to be | | 602 | utility is expected to be |
603 | .St -p1003.2 | | 603 | .St -p1003.2 |
604 | compatible. | | 604 | compatible. |
605 | The flags | | 605 | The flags |
606 | .Fl e | | 606 | .Fl e |
607 | and | | 607 | and |
608 | .Fl f | | 608 | .Fl f |
609 | are | | 609 | are |
610 | extensions to the standard, as are the operands mentioned in the control | | 610 | extensions to the standard, as are the operands mentioned in the control |
611 | operations section. | | 611 | operations section. |