Initial import, 0.1 + pk 0.2.4-B1
[unix-history] / bin / stty / stty.1
CommitLineData
15637ed4
RG
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the Institute of Electrical and Electronics Engineers, Inc.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\" notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\" notice, this list of conditions and the following disclaimer in the
14.\" documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\" must display the following acknowledgement:
17.\" This product includes software developed by the University of
18.\" California, Berkeley and its contributors.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\" may be used to endorse or promote products derived from this software
21.\" without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\" @(#)stty.1 6.13 (Berkeley) 6/27/91
36.\"
37.Dd June 27, 1991
38.Dt STTY 1
39.Os
40.Sh NAME
41.Nm stty
42.Nd Set the options for a terminal device interface.
43.Sh SYNOPSIS
44.Nm stty
45.Op Fl a | Fl e | Fl g
46.Op Fl f Ar file
47.Op operands
48.Sh DESCRIPTION
49The
50.Nm stty
51utility sets or reports on terminal
52characteristics for the device that is its standard input.
53If no options or operands are specified, it reports the settings of a set
54of characteristics as well as additional ones if they differ from their
55default values.
56Otherwise it modifies
57the terminal state according to the specified arguments.
58Some combinations of arguments are mutually
59exclusive on some terminal types.
60.Pp
61The following options are available:
62.Bl -tag -width Ds
63.It Fl a
64Display all the current settings for the terminal to standard output
65in the
66.St -p1003.2 .
67.It Fl e
68Display all the current settings for the terminal to standard output
69in the traditional
70.Tn BSD
71``all'' and ``everything'' formats.
72.It Fl f
73Display the current settings for the terminal named by
74.Ar file .
75.It Fl g
76Display all the current settings for the terminal to standard output
77in a form that may be used as an argument to a subsequent invocation of
78.Nm stty
79to restore the current terminal state.
80.El
81.Pp
82The following arguments are available to set the terminal
83characteristics:
84.Bl -tag -width Fl
85.It Cm parenb Pq Fl parenb
86Enable (disable) parity generation
87and detection.
88.It Cm parodd Pq Fl parodd
89Select odd (even) parity.
90.It Cm cs5 cs6 cs7 cs8
91Select character size, if possible.
92.It Ar number
93Set terminal baud rate to the
94number given, if possible.
95If the
96baud rate is set to zero, modem
97control is no longer
98asserted.
99.It Cm ispeed Ar number
100Set terminal input baud rate to the
101number given, if possible.
102If the
103input baud rate is set to zero, the
104input baud rate is set to the
105value of the output baud
106rate.
107.It Cm ospeed Ar number
108Set terminal output baud rate to
109the number given, if possible.
110If
111the output baud rate is set to
112zero, modem control is
113no longer asserted.
114.It Cm hupcl Pq Fl hupcl
115Stop asserting modem control
116(do not stop asserting modem control) on last close.
117.It Cm hup Pq Fl hup
118Same as hupcl
119.Pq Fl hupcl .
120.It Cm cstopb Pq Fl cstopb
121Use two (one) stop bits per character.
122.It Cm cread Pq Fl cread
123Enable (disable) the receiver.
124.It Cm clocal Pq Fl clocal
125Assume a line without (with) modem
126control.
127.It Cm ignbrk Pq Fl ignbrk
128Ignore (do not ignore) break on
129input.
130.It Cm brkint Pq Fl brkint
131Signal (do not signal)
132.Dv INTR
133on
134break.
135.It Cm ignpar Pq Fl ignpar
136Ignore (do not ignore) parity
137errors.
138.It Cm parmrk Pq Fl parmrk
139Mark (do not mark) parity errors.
140.It Cm inpck Pq Fl inpck
141Enable (disable) input parity
142checking.
143.It Cm istrip Pq Fl istrip
144Strip (do not strip) input characters
145to seven bits.
146.It Cm inlcr Pq Fl inlcr
147Map (do not map)
148.Dv NL
149to
150.Dv CR
151on input.
152.It Cm igncr Pq Fl igncr
153Ignore (do not ignore)
154.Dv CR
155on input.
156.It Cm icrnl Pq Fl icrnl
157Map (do not map)
158.Dv CR
159to
160.Dv NL
161on input.
162.It Cm ixon Pq Fl ixon
163Enable (disable)
164.Dv START/STOP
165output
166control.
167Output from the system is
168stopped when the system receives
169.Dv STOP
170and started when the system
171receives
172.Dv START .
173.It Cm ixoff Pq Fl ixoff
174Request that the system send (not
175send)
176.Dv START/STOP
177characters when
178the input queue is nearly
179empty/full.
180.It Cm opost Pq Fl opost
181Post-process output (do not
182post-process output; ignore all other
183output modes).
184.It Cm isig Pq Fl isig
185Enable (disable) the checking of
186characters against the special control
187characters
188.Dv INTR , QUIT ,
189and
190.Dv SUSP .
191.It Cm icanon Pq Fl icanon
192Enable (disable) canonical input
193.Pf ( Dv ERASE
194and
195.Dv KILL
196processing).
197.It Cm iexten Pq Fl iexten
198Enable (disable) any implementation
199defined special control characters
200not currently controlled by icanon,
201isig, or ixon.
202.It Cm echo Pq Fl echo
203Echo back (do not echo back) every
204character typed.
205.It Cm echoe Pq Fl echoe
206The
207.Dv ERASE
208character shall (shall
209not) visually erase the last character
210in the current line from the
211display, if possible.
212.It Cm echok Pq Fl echok
213Echo (do not echo)
214.Dv NL
215after
216.Dv KILL
217character.
218.It Cm echonl Pq Fl echonl
219Echo (do not echo)
220.Dv NL ,
221even if echo
222is disabled.
223.It Cm noflsh Pq Fl noflsh
224Disable (enable) flush after
225.Dv INTR , QUIT , SUSP .
226.It Cm control-character Ar string
227Set control-character to string.
228If string is a single character,
229the control character is set to
230that character.
231If string is the
232two character sequence "^-" or the
233string "undef" the control character
234is set to
235.Pf { Dv _POSIX_VDISABLE Ns }
236if
237it is in effect for the device; if
238.Pf { Dv _POSIX_VDISABLE Ns }
239is not in effect
240for the device, it is an
241error.
242.Pp
243Recognized control-characters:
244.Bd -ragged -offset indent
245.Bl -column character Subscript
246.It control- Ta Tn POSIX.1
247.It character Subscript Description
248.It _________ _________ _______________
249.It eof Ta Tn VEOF EOF No character
250.It eol Ta Tn VEOL EOL No character
251.It erase Ta Tn VERASE ERASE No character
252.It intr Ta Tn VINTR INTR No character
253.It kill Ta Tn VKILL KILL No character
254.It quit Ta Tn VQUIT QUIT No character
255.It susp Ta Tn VSUSP SUSP No character
256.It start Ta Tn VSTART START No character
257.It stop Ta Tn VSTOP STOP No character
258.El
259.Ed
260.It Cm saved settings
261Set the current terminal
262characteristics to the saved settings
263produced by the
264.Fl g
265option.
266.It Cm min Ar number
267.It Cm time Ar number
268Set the value of min or time to
269number.
270.Dv MIN
271and
272.Dv TIME
273are used in
274Non-Canonical mode input processing
275(-icanon).
276.It Cm evenp No or Cm parity
277Enable parenb and cs7; disable
278parodd.
279.It Cm oddp
280Enable parenb, cs7, and parodd.
281.It Fl parity , evenp , oddp
282Disable parenb, and set cs8.
283.It Cm nl Pq Fl nl
284Enable (disable) icrnl.
285In addition
286-nl unsets inlcr and igncr.
287.It Cm ek
288Reset
289.Dv ERASE
290and
291.Dv KILL
292characters
293back to system defaults.
294.It Cm sane
295Resets all modes to reasonable values for interactive terminal use.
296.It Cm tty
297Set the line discipline to the standard terminal line discipline
298.Dv TTYDISC .
299.El
300.Pp
301The
302.Nm stty
303utility exits with a value of 0 if successful, and >0 if an error occurs.
304.Sh SEE ALSO
305.Xr stty 4
306.Sh STANDARDS
307The
308.Nm stty
309function is expected to be
310.St -p1003.2
311compatible.