]> git.ipfire.org Git - thirdparty/util-linux.git/blob - term-utils/setterm.1
setarch: avoid NULL dereference [coverity check]
[thirdparty/util-linux.git] / term-utils / setterm.1
1 .\" Copyright 1990 Gordon Irlam (gordoni@cs.ua.oz.au)
2 .\" Copyright 1992 Rickard E. Faith (faith@cs.unc.edu)
3 .\" Copyright 2000 Colin Watson (cjw44@cam.ac.uk)
4 .\" Do not restrict distribution.
5 .\" May be distributed under the GNU General Public License
6 .\"
7 .TH SETTERM 1 "May 2014" "util-linux" "User Commands"
8 .SH NAME
9 setterm \- set terminal attributes
10 .SH SYNOPSIS
11 .B setterm
12 [options]
13 .SH DESCRIPTION
14 .B setterm
15 writes to standard output a character string that will invoke the specified
16 terminal capabilities. Where possible
17 .I terminfo
18 is consulted to find the string to use. Some options however (marked "virtual
19 consoles only" below) do not correspond to a
20 .BR terminfo (5)
21 capability. In this case, if the terminal type is "con" or "linux" the string
22 that invokes the specified capabilities on the PC Minix virtual console driver
23 is output. Options that are not implemented by the terminal are ignored.
24 .SH OPTIONS
25 For boolean options
26 .RB ( on " or " off ),
27 the default is
28 .BR on .
29 .P
30 Below, an
31 .I 8-color
32 can be
33 .BR black ,
34 .BR red ,
35 .BR green ,
36 .BR yellow ,
37 .BR blue ,
38 .BR magenta ,
39 .BR cyan ,
40 or
41 .BR white .
42 .P
43 A
44 .I 16-color
45 can be an
46 .IR 8-color ,
47 or
48 .BR grey ,
49 or
50 .B bright
51 followed
52 by
53 .BR red ,
54 .BR green ,
55 .BR yellow ,
56 .BR blue ,
57 .BR magenta ,
58 .BR cyan ,
59 or
60 .BR white .
61 .P
62 The various color options may be set independently, at least on virtual
63 consoles, though the results of setting multiple modes (for example,
64 .B \-\-underline
65 and
66 .BR \-\-half\-bright )
67 are hardware-dependent.
68 .TP
69 \fB\-\-appcursorkeys\fP [\fBon\fP|\fBoff\fP] (virtual consoles only)
70 Sets Cursor Key Application Mode on or off. When on, ESC O A, ESC O B, etc.
71 will be sent for the cursor keys instead of ESC [ A, ESC [ B, etc. See the
72 .I vi and Cursor-Keys
73 section of the
74 .I Text-Terminal-HOWTO
75 for how this can cause problems for \fBvi\fR users.
76 .TP
77 \fB\-\-append\fP [\fIconsole_number\fP]
78 Like
79 .BR \-\-dump ,
80 but appends to the snapshot file instead of overwriting it. Only works if no
81 .B \-\-dump
82 options are given.
83 .TP
84 \fB\-\-background\fP \fI8-color\fP|\fBdefault\fP
85 Sets the background text color.
86 .TP
87 \fB\-\-blank\fP [\fB0-60\fP|\fBforce\fP|\fBpoke\fP] (virtual consoles only)
88 Sets the interval of inactivity, in minutes, after which the screen will be
89 automatically blanked (using APM if available). Without an argument, it gets
90 the blank status (returns which vt was blanked, or zero for an unblanked vt).
91 .IP
92 The
93 .B force
94 option keeps the screen blank even if a key is pressed.
95 .IP
96 The
97 .B poke
98 option unblanks the screen.
99 .TP
100 \fB\-\-bfreq\fP [\fInumber\fP] (virtual consoles only)
101 Sets the bell frequency in Hertz. Without an argument, it defaults to
102 .BR 0 .
103 .TP
104 \fB\-\-blength\fP [\fB0-2000\fP] (virtual consoles only)
105 Sets the bell duration in milliseconds. Without an argument, it defaults to
106 .BR 0 .
107 .TP
108 .BR \-\-blink " [" on | off ]
109 Turns blink mode on or off. Except on a virtual console,
110 .B \-\-blink off
111 turns off all attributes (bold, half-brightness, blink, reverse).
112 .TP
113 .BR \-\-bold " [" on | off ]
114 Turns bold (extra bright) mode on or off. Except on a virtual console,
115 .B \-\-bold off
116 turns off all attributes (bold, half-brightness, blink, reverse).
117 .TP
118 \fB\-\-clear\fP [\fBall\fP|\fBrest\fP]
119 Without an argument or with the argument
120 .BR all ,
121 the entire screen is cleared and the cursor is set to the home position,
122 just like
123 .BR clear (1)
124 does. With the argument
125 .BR rest ,
126 the screen is cleared from the current cursor position to the end.
127 .TP
128 \fB\-\-clrtabs\fP [\fItab1 tab2 tab3\fP ...] (virtual consoles only)
129 Clears tab stops from the given horizontal cursor positions, in the range
130 .BR 1-160 .
131 Without arguments, it clears all tab stops.
132 .TP
133 .BR \-\-cursor " [" on | off ]
134 Turns the terminal's cursor on or off.
135 .TP
136 \fB\-\-default\fP
137 Sets the terminal's rendering options to the default values.
138 .TP
139 \fB\-\-dump\fP [\fIconsole_number\fP]
140 Writes a snapshot of the virtual console with the given number
141 to the file specified with the
142 .B \-\-file
143 option, overwriting its contents; the default is
144 .IR screen.dump .
145 Without an argument, it dumps the current virtual console. This overrides
146 .BR \-\-append .
147 .TP
148 \fB\-\-file\fP \fIfilename\fP
149 Sets the snapshot file name for any
150 .B \-\-dump
151 or
152 .B \-\-append
153 options on the same command line. If this option is not present, the default
154 is
155 .I screen.dump
156 in the current directory. A path name that exceeds the system maximum will be
157 truncated, see PATH_MAX from linux/limits.h for the value.
158 .TP
159 \fB\-\-foreground\fP \fI8-color\fP|\fBdefault\fP
160 Sets the foreground text color.
161 .TP
162 .BR \-\-half\-bright " [" on | off ]
163 Turns dim (half-brightness) mode on or off. Except on a virtual console,
164 .B \-\-half\-bright off
165 turns off all attributes (bold, half-brightness, blink, reverse).
166 .TP
167 \fB\-\-hbcolor\fP \fI16-color\fP
168 Sets the color for half-bright characters.
169 .TP
170 \fB\-\-initialize\fP
171 Displays the terminal initialization string, which typically sets the
172 terminal's rendering options, and other attributes to the default values.
173 .TP
174 .BR \-\-inversescreen " [" on | off ]
175 Swaps foreground and background colors for the whole screen.
176 .TP
177 .BR \-\-linewrap " [" on | off ]
178 Makes the terminal continue on a new line when a line is full.
179 .TP
180 .BR \-\-msg " [" on | off "] (virtual consoles only)"
181 Enables or disables the sending of kernel
182 .BR printk ()
183 messages to the console.
184 .TP
185 \fB\-\-msglevel\fP \fB0-8\fP (virtual consoles only)
186 Sets the console logging level for kernel
187 .B printk()
188 messages. All messages strictly more important than this will be printed, so a
189 logging level of
190 .B 0
191 has the same effect as
192 .B \-\-msg on
193 and a logging level of
194 .B 8
195 will print all kernel messages.
196 .BR klogd (8)
197 may be a more convenient interface to the logging of kernel messages.
198 .TP
199 \fB\-\-powerdown\fP [\fB0-60\fP]
200 Sets the VESA powerdown interval in minutes. Without an argument, it defaults
201 to
202 .B 0
203 (disable powerdown). If the console is blanked or the monitor is in suspend
204 mode, then the monitor will go into vsync suspend mode or powerdown mode
205 respectively after this period of time has elapsed.
206 .TP
207 \fB\-\-powersave\fP \fBoff\fP
208 Turns off monitor VESA powersaving features.
209 .TP
210 \fB\-\-powersave\fP \fBon\fP|\fBvsync\fP
211 Puts the monitor into VESA vsync suspend mode.
212 .TP
213 \fB\-\-powersave\fP \fBpowerdown\fP
214 Puts the monitor into VESA powerdown mode.
215 .TP
216 \fB\-\-powersave\fP \fBhsync\fP
217 Puts the monitor into VESA hsync suspend mode.
218 .TP
219 \fB\-\-regtabs\fP [\fB1-160\fP] (virtual consoles only)
220 Clears all tab stops, then sets a regular tab stop pattern, with one tab every
221 specified number of positions. Without an argument, it defaults to
222 .BR 8 .
223 .TP
224 .BR \-\-repeat " [" on | off "] (virtual consoles only)"
225 Turns keyboard repeat on or off.
226 .TP
227 \fB\-\-reset\fP
228 Displays the terminal reset string, which typically resets the terminal to
229 its power-on state.
230 .TP
231 \fB\-\-resize\fP
232 Reset terminal size by assessing maximum row and column. This is useful
233 when actual geometry and kernel terminal driver are not in sync. Most
234 notable use case is with serial consoles, that do not use
235 .BR ioctl (3)
236 but just byte streams and breaks.
237 .TP
238 \fB\-\-reverse\fP [\fBon\fP|\fBoff\fP]
239 Turns reverse video mode on or off. Except on a virtual console,
240 .B \-\-reverse off
241 turns off all attributes (bold, half-brightness, blink, reverse).
242 .TP
243 \fB\-\-store\fP (virtual consoles only)
244 Stores the terminal's current rendering options (foreground and background
245 colors) as the values to be used at reset-to-default.
246 .TP
247 \fB\-\-tabs\fP [\fItab1 tab2 tab3\fP ...]
248 Sets tab stops at the given horizontal cursor positions, in the range
249 .BR 1-160 .
250 Without arguments, it shows the current tab stop settings.
251 .TP
252 \fB\-\-term\fP \fIterminal_name\fP
253 Overrides the TERM environment variable.
254 .TP
255 \fB\-\-ulcolor\fP \fI16-color\fP (virtual consoles only)
256 Sets the color for underlined characters.
257 .TP
258 .BR \-\-underline " [" on | off ]
259 Turns underline mode on or off.
260 .TP
261 \fB\-\-version\fP
262 Displays version information and exits.
263 .TP
264 \fB\-\-help\fP
265 Displays a help text and exits.
266 .SH COMPATIBILITY
267 Since version 2.25
268 .B setterm
269 has support for long options with two hyphens, for example
270 .BR \-\-help ,
271 beside the historical long options with a single hyphen, for example
272 .BR \-help .
273 In scripts it is better to use the backward-compatible single hyphen
274 rather than the double hyphen. Currently there are no plans nor good
275 reasons to discontinue single-hyphen compatibility.
276 .SH "SEE ALSO"
277 .BR stty (1),
278 .BR tput (1),
279 .BR tty (4),
280 .BR terminfo (5)
281 .SH BUGS
282 Differences between the Minix and Linux versions are not documented.
283 .SH AVAILABILITY
284 The setterm command is part of the util-linux package and is available from
285 .UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
286 Linux Kernel Archive
287 .UE .