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