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