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