Commit | Line | Data |
---|---|---|
daacd5f0 CL |
1 | .\" Copyright (c) 1990 The Regents of the University of California. |
2 | .\" All rights reserved. | |
f899fcd3 | 3 | .\" |
daacd5f0 | 4 | .\" %sccs.include.redist.man% |
f899fcd3 | 5 | .\" |
d0719240 | 6 | .\" @(#)stty.1 6.9 (Berkeley) %G% |
daacd5f0 | 7 | .\" |
ee9b0a0a CL |
8 | .Vx |
9 | .Vx | |
daacd5f0 CL |
10 | .Dd |
11 | .Dt STTY 1 | |
ee9b0a0a | 12 | .Os |
daacd5f0 CL |
13 | .Sh NAME |
14 | .Nm stty | |
11bf6c15 | 15 | .Nd set the options for a terminal device interface |
daacd5f0 CL |
16 | .Sh SYNOPSIS |
17 | .Nm stty | |
18 | .Op Fl a Ar \&| Fl g | |
19 | .Nm stty | |
20 | .Op arguments | |
21 | .De | |
22 | .Sh DESCRIPTION | |
23 | The stty utility sets or reports on terminal I/O | |
24 | characteristics for the device that is its standard input. | |
25 | Without options or arguments specified, it reports the | |
26 | settings of certain characteristics, usually those that differ | |
27 | from implementation-defined defaults. | |
28 | Otherwise it modifies | |
29 | the terminal state according to the specified arguments. | |
30 | Some combinations of arguments are mutually | |
31 | exclusive on some terminal types. | |
32 | .Pp | |
33 | The following options are available: | |
5325ced3 | 34 | .Tw Ds |
daacd5f0 CL |
35 | .Tp Fl a |
36 | Write to standard output all the current settings | |
37 | for the terminal. | |
38 | .Tp Fl g | |
11bf6c15 MK |
39 | Write the current settings to standard output in a |
40 | form that can be used as arguments to | |
daacd5f0 CL |
41 | another stty utility on the same system. |
42 | .Tp | |
43 | .Pp | |
44 | The following arguments are available to set the terminal | |
45 | characteristics: | |
46 | .Tw Fl | |
47 | .Tc Cm parenb | |
48 | .Ws | |
49 | .Pf \&( Fl parenb ) | |
50 | .Cx | |
51 | Enable (disable) parity generation | |
52 | and detection. | |
53 | .Tc Cm parodd | |
54 | .Ws | |
55 | .Pf \&( Fl parodd ) | |
56 | .Cx | |
57 | Select odd (even) parity. | |
58 | .Tp Cm cs5 cs6 cs7 cs8 | |
59 | Select character size, if possible. | |
60 | .Tp Ar number | |
61 | Set terminal baud rate to the | |
62 | number given, if possible. | |
63 | If the | |
64 | baud rate is set to zero, modem | |
65 | control is no longer | |
66 | asserted. | |
67 | .Tc Cm ispeed | |
68 | .Ws | |
69 | .Ar number | |
70 | .Cx | |
71 | Set terminal input baud rate to the | |
72 | number given, if possible. | |
73 | If the | |
74 | input baud rate is set to zero, the | |
75 | input baud rate is set to the | |
76 | value of the output baud | |
77 | rate. | |
78 | .Tc Cm ospeed | |
79 | .Ws | |
80 | .Ar number | |
81 | .Cx | |
82 | Set terminal output baud rate to | |
83 | the number given, if possible. | |
84 | If | |
85 | the output baud rate is set to | |
86 | zero, modem control is | |
87 | no longer asserted. | |
88 | .Tc Cm hupcl | |
89 | .Ws | |
90 | .Pf \&( Fl hupcl ) | |
91 | .Cx | |
92 | Stop asserting modem control | |
93 | (do not stop asserting modem control) on last close. | |
94 | .Tc Cm hup | |
95 | .Ws | |
96 | .Pf \&( Fl hup ) | |
97 | .Cx | |
98 | Same as hupcl | |
99 | .Ws | |
100 | .Pf \&( Fl hupcl). | |
101 | .Tc Cm cstopb | |
102 | .Ws | |
103 | .Pf \&( Fl cstopb ) | |
104 | .Cx | |
105 | Use two (one) stop bits per character. | |
106 | .Tc Cm cread | |
107 | .Ws | |
108 | .Pf \&( Fl cread ) | |
109 | .Cx | |
110 | Enable (disable) the receiver. | |
111 | .Tc Cm clocal | |
112 | .Ws | |
113 | .Pf \&( Fl clocal ) | |
114 | .Cx | |
115 | Assume a line without (with) modem | |
116 | control. | |
117 | .Tc Cm ignbrk | |
118 | .Ws | |
119 | .Pf \&( Fl ignbrk ) | |
120 | .Cx | |
121 | Ignore (do not ignore) break on | |
122 | input. | |
123 | .Tc Cm brkint | |
124 | .Ws | |
125 | .Pf \&( Fl brkint ) | |
126 | .Cx | |
127 | Signal (do not signal) INTR on | |
128 | break. | |
129 | .Tc Cm ignpar | |
130 | .Ws | |
131 | .Pf \&( Fl ignpar ) | |
132 | .Cx | |
133 | Ignore (do not ignore) parity | |
134 | errors. | |
135 | .Tc Cm parmrk | |
136 | .Ws | |
137 | .Pf \&( Fl parmrk ) | |
138 | .Cx | |
139 | Mark (do not mark) parity errors. | |
140 | .Tc Cm inpck | |
141 | .Ws | |
142 | .Pf \&( Fl inpck ) | |
143 | .Cx | |
144 | Enable (disable) input parity | |
145 | checking. | |
146 | .Tc Cm istrip | |
147 | .Ws | |
148 | .Pf \&( Fl istrip ) | |
149 | .Cx | |
150 | Strip (do not strip) input characters | |
151 | to seven bits. | |
152 | .Tc Cm inlcr | |
153 | .Ws | |
154 | .Pf \&( Fl inlcr ) | |
155 | .Cx | |
156 | Map (do not map) NL to CR on input. | |
157 | .Tc Cm igncr | |
158 | .Ws | |
159 | .Pf \&( Fl igncr ) | |
160 | .Cx | |
161 | Ignore (do not ignore) CR on input. | |
162 | .Tc Cm icrnl | |
163 | .Ws | |
164 | .Pf \&( Fl icrnl ) | |
165 | .Cx | |
166 | Map (do not map) CR to NL on input. | |
167 | .Tc Cm ixon | |
168 | .Ws | |
169 | .Pf \&( Fl ixon ) | |
170 | .Cx | |
171 | Enable (disable) START/STOP output | |
172 | control. | |
173 | Output from the system is | |
174 | stopped when the system receives | |
175 | STOP and started when the system | |
176 | receives START. | |
177 | .Tc Cm ixoff | |
178 | .Ws | |
179 | .Pf \&( Fl ixoff ) | |
180 | .Cx | |
181 | Request that the system send (not | |
182 | send) START/STOP characters when | |
183 | the input queue is nearly | |
184 | empty/full. | |
185 | .Tc Cm opost | |
186 | .Ws | |
187 | .Pf \&( Fl opost ) | |
188 | .Cx | |
189 | Post-process output (do not | |
190 | post-process output; ignore all other | |
191 | output modes). | |
192 | .Tc Cm isig | |
193 | .Ws | |
194 | .Pf \&( Fl isig ) | |
195 | .Cx | |
196 | Enable (disable) the checking of | |
197 | characters against the special control | |
198 | characters INTR, QUIT, and | |
199 | SUSP. | |
200 | .Tc Cm icanon | |
201 | .Ws | |
202 | .Pf \&( Fl icanon ) | |
203 | .Cx | |
204 | Enable (disable) canonical input | |
205 | (ERASE and KILL processing). | |
206 | .Tc Cm iexten | |
207 | .Ws | |
208 | .Pf \&( Fl iexten ) | |
209 | .Cx | |
210 | Enable (disable) any implementation | |
211 | defined special control characters | |
212 | not currently controlled by icanon, | |
213 | isig, or ixon. | |
214 | .Tc Cm echo | |
215 | .Ws | |
216 | .Pf \&( Fl echo ) | |
217 | .Cx | |
218 | Echo back (do not echo back) every | |
219 | character typed. | |
220 | .Tc Cm echoe | |
221 | .Ws | |
222 | .Pf \&( Fl echoe ) | |
223 | .Cx | |
224 | The ERASE character shall (shall | |
225 | not) visually erase the last character | |
226 | in the current line from the | |
227 | display, if possible. | |
228 | .Tc Cm echok | |
229 | .Ws | |
230 | .Pf \&( Fl echok ) | |
231 | .Cx | |
232 | Echo (do not echo) NL after KILL | |
233 | character. | |
234 | .Tc Cm echonl | |
235 | .Ws | |
236 | .Pf \&( Fl echonl ) | |
237 | .Cx | |
238 | Echo (do not echo) NL, even if echo | |
239 | is disabled. | |
240 | .Tc Cm noflsh | |
241 | .Ws | |
242 | .Pf \&( Fl noflsh ) | |
243 | .Cx | |
244 | Disable (enable) flush after INTR, | |
245 | QUIT, SUSP. | |
246 | .Tc Cm control-character | |
247 | .Ws | |
248 | .Ar string | |
249 | .Cx | |
250 | Set control-character to string. | |
251 | If string is a single character, | |
252 | the control character is set to | |
253 | that character. | |
254 | If string is the | |
255 | two character sequence "^-" or the | |
256 | string "undef" the control character | |
257 | is set to {_POSIX_VDISABLE} if | |
258 | it is in effect for the device; if | |
259 | {_POSIX_VDISABLE} is not in effect | |
260 | for the device, it is an | |
261 | error. | |
262 | .Pp | |
263 | Recognized control-characters: | |
264 | .Ds I | |
265 | .Cw character Subscript | |
266 | .Cl control- POSIX.1 | |
267 | .Cl character Subscript Description | |
268 | .Cl _________ _________ _______________ | |
269 | .Cl eof VEOF EOF character | |
270 | .Cl eol VEOL EOL character | |
271 | .Cl erase VERASE ERASE character | |
272 | .Cl intr VINTR INTR character | |
273 | .Cl kill VKILL KILL character | |
274 | .Cl quit VQUIT QUIT character | |
275 | .Cl susp VSUSP SUSP character | |
276 | .Cl start VSTART START character | |
277 | .Cl stop VSTOP STOP character | |
278 | .Cw | |
279 | .De | |
280 | .Tp Cm saved settings | |
281 | Set the current terminal | |
282 | characteristics to the saved settings | |
11bf6c15 MK |
283 | produced by the |
284 | .Fl g | |
285 | option. | |
daacd5f0 CL |
286 | .Tc Cm min |
287 | .Ws | |
288 | .Ar number | |
289 | .Cx | |
11bf6c15 MK |
290 | .Tc Cm time |
291 | .Ws | |
292 | .Ar number | |
293 | .Cx | |
daacd5f0 CL |
294 | Set the value of min or time to |
295 | number. | |
296 | MIN and TIME are used in | |
297 | Non-Canonical mode input processing | |
298 | (-icanon). | |
299 | .Tc Cm evenp | |
300 | .Ws | |
301 | .Cx or | |
302 | .Ws | |
303 | .Cm parity | |
304 | .Cx | |
305 | Enable parenb and cs7; disable | |
306 | parodd. | |
307 | .Tp Cm oddp | |
308 | Enable parenb, cs7, and parodd. | |
309 | .Tp Fl parity , evenp , oddp | |
310 | Disable parenb, and set cs8. | |
311 | .Tc Cm nl | |
312 | .Ws | |
313 | .Pf \&( Fl nl ) | |
314 | .Cx | |
315 | Enable (disable) icrnl. | |
316 | In addition | |
317 | -nl unsets inlcr and igncr. | |
318 | .Tp Cm ek | |
319 | Reset ERASE and KILL characters | |
320 | back to system defaults. | |
321 | .Tp Cm sane | |
11bf6c15 MK |
322 | Resets all modes to reasonable values for interactive terminal use. |
323 | .Tp Cm tty | |
324 | Set the line discipline to the standard terminal line discipline TTYDISC. | |
daacd5f0 CL |
325 | .Tp |
326 | .Pp | |
11bf6c15 MK |
327 | If the |
328 | .Fl g | |
329 | option is specified, stty writes to standard output | |
daacd5f0 CL |
330 | the current settings in a form that can be used as arguments |
331 | to another instance of stty on the same system. | |
332 | .Pp | |
11bf6c15 MK |
333 | If the |
334 | .Fl a | |
335 | option is specified, all of the information about the current setting | |
336 | is written to standard output | |
337 | in the same format described for the arguments above. | |
338 | Unless otherwise specified, this information is displayed as | |
339 | <space>-separated tokens, on one or | |
340 | more lines, with one or more tokens per line. | |
daacd5f0 | 341 | .Pp |
11bf6c15 MK |
342 | If no options are specified, a subset of the |
343 | information displayed for the | |
344 | .Fl a | |
345 | option is displayed. | |
daacd5f0 CL |
346 | .Pp |
347 | If the terminal input speed and output speed are the same, | |
348 | the speed information is displayed as follows: | |
349 | .Pp | |
350 | .Ds I | |
351 | "speed %d baud;", <speed> | |
352 | .De | |
5325ced3 | 353 | .Pp |
daacd5f0 CL |
354 | Otherwise speeds are displayed as: |
355 | .Pp | |
356 | .Ds I | |
357 | "ispeed %d baud; ospeed %d baud;", <ispeed>, <ospeed> | |
358 | .De | |
5325ced3 | 359 | .Pp |
daacd5f0 CL |
360 | Control characters are displayed as: |
361 | .Pp | |
362 | .Ds I | |
363 | "%s = %s;", <control-character name>, <value> | |
364 | .De | |
5325ced3 | 365 | .Pp |
daacd5f0 CL |
366 | where value is either the character, or some visual |
367 | representation of the character if it is non-printing, or | |
368 | the string "<undef>" if the character is disabled. | |
369 | .Pp | |
370 | The | |
371 | .Nm stty | |
372 | utility exits with one of the following values: | |
373 | .Tw Ds | |
374 | .Tp Li \&0 | |
375 | The terminal options were read or set successfully. | |
376 | .Tp Li \&>0 | |
377 | An error occurred. | |
378 | .Tp | |
379 | .Sh SEE ALSO | |
380 | .Xr stty 4 | |
381 | .Sh STANDARDS | |
382 | The | |
383 | .Nm stty | |
384 | function is expected to be POSIX 1003.2 compatible. |