Commit | Line | Data |
---|---|---|
daacd5f0 CL |
1 | .\" Copyright (c) 1990 The Regents of the University of California. |
2 | .\" All rights reserved. | |
f899fcd3 | 3 | .\" |
ae122740 KB |
4 | .\" This code is derived from software contributed to Berkeley by |
5 | .\" the Institute of Electrical and Electronics Engineers, Inc. | |
6 | .\" | |
daacd5f0 | 7 | .\" %sccs.include.redist.man% |
f899fcd3 | 8 | .\" |
19b5ee2d | 9 | .\" @(#)stty.1 6.16 (Berkeley) %G% |
daacd5f0 CL |
10 | .\" |
11 | .Dd | |
12 | .Dt STTY 1 | |
ee9b0a0a | 13 | .Os |
daacd5f0 CL |
14 | .Sh NAME |
15 | .Nm stty | |
11bf6c15 | 16 | .Nd set the options for a terminal device interface |
daacd5f0 CL |
17 | .Sh SYNOPSIS |
18 | .Nm stty | |
d3da8ba2 KB |
19 | .Op Fl a | Fl e | Fl g |
20 | .Op Fl f Ar file | |
21 | .Op operands | |
daacd5f0 | 22 | .Sh DESCRIPTION |
4f680921 | 23 | The |
d3da8ba2 KB |
24 | .Nm stty |
25 | utility sets or reports on terminal | |
daacd5f0 | 26 | characteristics for the device that is its standard input. |
4d0f9b97 KB |
27 | If no options or operands are specified, it reports the settings of a set |
28 | of characteristics as well as additional ones if they differ from their | |
29 | default values. | |
daacd5f0 CL |
30 | Otherwise it modifies |
31 | the terminal state according to the specified arguments. | |
32 | Some combinations of arguments are mutually | |
33 | exclusive on some terminal types. | |
34 | .Pp | |
35 | The following options are available: | |
d3da8ba2 KB |
36 | .Bl -tag -width Ds |
37 | .It Fl a | |
4f680921 CL |
38 | Display all the current settings for the terminal to standard output |
39 | as per | |
d3da8ba2 KB |
40 | .St -p1003.2 . |
41 | .It Fl e | |
4f680921 | 42 | Display all the current settings for the terminal to standard output |
d3da8ba2 KB |
43 | in the traditional |
44 | .Tn BSD | |
45 | ``all'' and ``everything'' formats. | |
46 | .It Fl f | |
47 | Display the current settings for the terminal named by | |
48 | .Ar file . | |
49 | .It Fl g | |
4f680921 | 50 | Display all the current settings for the terminal to standard output |
4d0f9b97 KB |
51 | in a form that may be used as an argument to a subsequent invocation of |
52 | .Nm stty | |
4f680921 | 53 | to restore the current terminal state as per |
19b5ee2d | 54 | .St -p1003.2 . |
d3da8ba2 | 55 | .El |
daacd5f0 CL |
56 | .Pp |
57 | The following arguments are available to set the terminal | |
58 | characteristics: | |
d3da8ba2 KB |
59 | .Bl -tag -width Fl |
60 | .It Cm parenb Pq Fl parenb | |
daacd5f0 CL |
61 | Enable (disable) parity generation |
62 | and detection. | |
d3da8ba2 | 63 | .It Cm parodd Pq Fl parodd |
daacd5f0 | 64 | Select odd (even) parity. |
d3da8ba2 | 65 | .It Cm cs5 cs6 cs7 cs8 |
daacd5f0 | 66 | Select character size, if possible. |
d3da8ba2 | 67 | .It Ar number |
daacd5f0 CL |
68 | Set terminal baud rate to the |
69 | number given, if possible. | |
70 | If the | |
71 | baud rate is set to zero, modem | |
72 | control is no longer | |
73 | asserted. | |
d3da8ba2 | 74 | .It Cm ispeed Ar number |
daacd5f0 CL |
75 | Set terminal input baud rate to the |
76 | number given, if possible. | |
77 | If the | |
78 | input baud rate is set to zero, the | |
79 | input baud rate is set to the | |
80 | value of the output baud | |
81 | rate. | |
d3da8ba2 | 82 | .It Cm ospeed Ar number |
daacd5f0 CL |
83 | Set terminal output baud rate to |
84 | the number given, if possible. | |
85 | If | |
86 | the output baud rate is set to | |
87 | zero, modem control is | |
88 | no longer asserted. | |
d3da8ba2 | 89 | .It Cm hupcl Pq Fl hupcl |
daacd5f0 CL |
90 | Stop asserting modem control |
91 | (do not stop asserting modem control) on last close. | |
d3da8ba2 | 92 | .It Cm hup Pq Fl hup |
daacd5f0 | 93 | Same as hupcl |
d3da8ba2 KB |
94 | .Pq Fl hupcl . |
95 | .It Cm cstopb Pq Fl cstopb | |
daacd5f0 | 96 | Use two (one) stop bits per character. |
d3da8ba2 | 97 | .It Cm cread Pq Fl cread |
daacd5f0 | 98 | Enable (disable) the receiver. |
d3da8ba2 | 99 | .It Cm clocal Pq Fl clocal |
daacd5f0 CL |
100 | Assume a line without (with) modem |
101 | control. | |
d3da8ba2 | 102 | .It Cm ignbrk Pq Fl ignbrk |
daacd5f0 CL |
103 | Ignore (do not ignore) break on |
104 | input. | |
d3da8ba2 KB |
105 | .It Cm brkint Pq Fl brkint |
106 | Signal (do not signal) | |
107 | .Dv INTR | |
108 | on | |
daacd5f0 | 109 | break. |
d3da8ba2 | 110 | .It Cm ignpar Pq Fl ignpar |
daacd5f0 CL |
111 | Ignore (do not ignore) parity |
112 | errors. | |
d3da8ba2 | 113 | .It Cm parmrk Pq Fl parmrk |
daacd5f0 | 114 | Mark (do not mark) parity errors. |
d3da8ba2 | 115 | .It Cm inpck Pq Fl inpck |
daacd5f0 CL |
116 | Enable (disable) input parity |
117 | checking. | |
d3da8ba2 | 118 | .It Cm istrip Pq Fl istrip |
daacd5f0 CL |
119 | Strip (do not strip) input characters |
120 | to seven bits. | |
d3da8ba2 KB |
121 | .It Cm inlcr Pq Fl inlcr |
122 | Map (do not map) | |
123 | .Dv NL | |
124 | to | |
125 | .Dv CR | |
126 | on input. | |
127 | .It Cm igncr Pq Fl igncr | |
128 | Ignore (do not ignore) | |
129 | .Dv CR | |
130 | on input. | |
131 | .It Cm icrnl Pq Fl icrnl | |
132 | Map (do not map) | |
133 | .Dv CR | |
134 | to | |
135 | .Dv NL | |
136 | on input. | |
137 | .It Cm ixon Pq Fl ixon | |
138 | Enable (disable) | |
139 | .Dv START/STOP | |
140 | output | |
daacd5f0 CL |
141 | control. |
142 | Output from the system is | |
143 | stopped when the system receives | |
d3da8ba2 KB |
144 | .Dv STOP |
145 | and started when the system | |
146 | receives | |
147 | .Dv START . | |
148 | .It Cm ixoff Pq Fl ixoff | |
daacd5f0 | 149 | Request that the system send (not |
d3da8ba2 KB |
150 | send) |
151 | .Dv START/STOP | |
152 | characters when | |
daacd5f0 CL |
153 | the input queue is nearly |
154 | empty/full. | |
d3da8ba2 | 155 | .It Cm opost Pq Fl opost |
daacd5f0 CL |
156 | Post-process output (do not |
157 | post-process output; ignore all other | |
158 | output modes). | |
d3da8ba2 | 159 | .It Cm isig Pq Fl isig |
daacd5f0 CL |
160 | Enable (disable) the checking of |
161 | characters against the special control | |
d3da8ba2 KB |
162 | characters |
163 | .Dv INTR , QUIT , | |
164 | and | |
165 | .Dv SUSP . | |
166 | .It Cm icanon Pq Fl icanon | |
daacd5f0 | 167 | Enable (disable) canonical input |
d3da8ba2 KB |
168 | .Pf ( Dv ERASE |
169 | and | |
170 | .Dv KILL | |
171 | processing). | |
172 | .It Cm iexten Pq Fl iexten | |
daacd5f0 CL |
173 | Enable (disable) any implementation |
174 | defined special control characters | |
175 | not currently controlled by icanon, | |
176 | isig, or ixon. | |
d3da8ba2 | 177 | .It Cm echo Pq Fl echo |
daacd5f0 CL |
178 | Echo back (do not echo back) every |
179 | character typed. | |
d3da8ba2 KB |
180 | .It Cm echoe Pq Fl echoe |
181 | The | |
182 | .Dv ERASE | |
183 | character shall (shall | |
daacd5f0 CL |
184 | not) visually erase the last character |
185 | in the current line from the | |
186 | display, if possible. | |
d3da8ba2 KB |
187 | .It Cm echok Pq Fl echok |
188 | Echo (do not echo) | |
189 | .Dv NL | |
190 | after | |
191 | .Dv KILL | |
daacd5f0 | 192 | character. |
d3da8ba2 KB |
193 | .It Cm echonl Pq Fl echonl |
194 | Echo (do not echo) | |
195 | .Dv NL , | |
196 | even if echo | |
daacd5f0 | 197 | is disabled. |
d3da8ba2 KB |
198 | .It Cm noflsh Pq Fl noflsh |
199 | Disable (enable) flush after | |
200 | .Dv INTR , QUIT , SUSP . | |
201 | .It Cm control-character Ar string | |
daacd5f0 CL |
202 | Set control-character to string. |
203 | If string is a single character, | |
204 | the control character is set to | |
205 | that character. | |
206 | If string is the | |
207 | two character sequence "^-" or the | |
208 | string "undef" the control character | |
d3da8ba2 KB |
209 | is set to |
210 | .Pf { Dv _POSIX_VDISABLE Ns } | |
211 | if | |
daacd5f0 | 212 | it is in effect for the device; if |
d3da8ba2 KB |
213 | .Pf { Dv _POSIX_VDISABLE Ns } |
214 | is not in effect | |
daacd5f0 CL |
215 | for the device, it is an |
216 | error. | |
217 | .Pp | |
218 | Recognized control-characters: | |
d3da8ba2 KB |
219 | .Bd -ragged -offset indent |
220 | .Bl -column character Subscript | |
221 | .It control- Ta Tn POSIX.1 | |
222 | .It character Subscript Description | |
223 | .It _________ _________ _______________ | |
224 | .It eof Ta Tn VEOF EOF No character | |
225 | .It eol Ta Tn VEOL EOL No character | |
226 | .It erase Ta Tn VERASE ERASE No character | |
227 | .It intr Ta Tn VINTR INTR No character | |
228 | .It kill Ta Tn VKILL KILL No character | |
229 | .It quit Ta Tn VQUIT QUIT No character | |
230 | .It susp Ta Tn VSUSP SUSP No character | |
231 | .It start Ta Tn VSTART START No character | |
232 | .It stop Ta Tn VSTOP STOP No character | |
233 | .El | |
234 | .Ed | |
235 | .It Cm saved settings | |
daacd5f0 CL |
236 | Set the current terminal |
237 | characteristics to the saved settings | |
11bf6c15 MK |
238 | produced by the |
239 | .Fl g | |
240 | option. | |
d3da8ba2 KB |
241 | .It Cm min Ar number |
242 | .It Cm time Ar number | |
daacd5f0 CL |
243 | Set the value of min or time to |
244 | number. | |
d3da8ba2 KB |
245 | .Dv MIN |
246 | and | |
247 | .Dv TIME | |
248 | are used in | |
daacd5f0 CL |
249 | Non-Canonical mode input processing |
250 | (-icanon). | |
d3da8ba2 | 251 | .It Cm evenp No or Cm parity |
daacd5f0 CL |
252 | Enable parenb and cs7; disable |
253 | parodd. | |
d3da8ba2 | 254 | .It Cm oddp |
daacd5f0 | 255 | Enable parenb, cs7, and parodd. |
d3da8ba2 | 256 | .It Fl parity , evenp , oddp |
daacd5f0 | 257 | Disable parenb, and set cs8. |
8262c19a | 258 | .It Cm \&nl Pq Fl \&nl |
daacd5f0 CL |
259 | Enable (disable) icrnl. |
260 | In addition | |
261 | -nl unsets inlcr and igncr. | |
d3da8ba2 KB |
262 | .It Cm ek |
263 | Reset | |
264 | .Dv ERASE | |
265 | and | |
266 | .Dv KILL | |
267 | characters | |
daacd5f0 | 268 | back to system defaults. |
d3da8ba2 | 269 | .It Cm sane |
11bf6c15 | 270 | Resets all modes to reasonable values for interactive terminal use. |
d3da8ba2 KB |
271 | .It Cm tty |
272 | Set the line discipline to the standard terminal line discipline | |
273 | .Dv TTYDISC . | |
274 | .El | |
daacd5f0 | 275 | .Pp |
daacd5f0 CL |
276 | The |
277 | .Nm stty | |
4d0f9b97 | 278 | utility exits with a value of 0 if successful, and >0 if an error occurs. |
daacd5f0 CL |
279 | .Sh SEE ALSO |
280 | .Xr stty 4 | |
281 | .Sh STANDARDS | |
282 | The | |
283 | .Nm stty | |
d3da8ba2 KB |
284 | function is expected to be |
285 | .St -p1003.2 | |
4f680921 CL |
286 | compatible. The flags |
287 | .Fl e | |
288 | and | |
289 | .Fl f | |
19b5ee2d | 290 | are |
4f680921 | 291 | extensions to the standard. |