1SETTERM(1) User Commands SETTERM(1)
2
3
4
6 setterm - set terminal attributes
7
9 setterm [options]
10
12 setterm writes to standard output a character string that will invoke
13 the specified terminal capabilities. Where possible terminfo is
14 consulted to find the string to use. Some options however (marked
15 "virtual consoles only" below) do not correspond to a terminfo(5)
16 capability. In this case, if the terminal type is "con" or "linux" the
17 string that invokes the specified capabilities on the PC Minix virtual
18 console driver is output. Options that are not implemented by the
19 terminal are ignored.
20
22 For boolean options (on or off), the default is on.
23
24 Below, an 8-color can be black, red, green, yellow, blue, magenta,
25 cyan, or white.
26
27 A 16-color can be an 8-color, or grey, or bright followed by red,
28 green, yellow, blue, magenta, cyan, or white.
29
30 The various color options may be set independently, at least on virtual
31 consoles, though the results of setting multiple modes (for example,
32 --underline and --half-bright) are hardware-dependent.
33
34 The optional arguments require '=' (equals sign) and not space between
35 the option and the argument. For example --option=argument.
36
37 --appcursorkeys on|off
38 Sets Cursor Key Application Mode on or off. When on, ESC O A, ESC O
39 B, etc. will be sent for the cursor keys instead of ESC [ A, ESC [
40 B, etc. See the vi and Cursor-Keys section of the
41 Text-Terminal-HOWTO for how this can cause problems for vi users.
42 Virtual consoles only.
43
44 --append console_number
45 Like --dump, but appends to the snapshot file instead of
46 overwriting it. Only works if no --dump options are given.
47
48 --background 8-color|default
49 Sets the background text color.
50
51 --blank[=0-60|force|poke]
52 Sets the interval of inactivity, in minutes, after which the screen
53 will be automatically blanked (using APM if available). Without an
54 argument, it gets the blank status (returns which vt was blanked,
55 or zero for an unblanked vt). Virtual consoles only.
56
57 The force argument keeps the screen blank even if a key is pressed.
58
59 The poke argument unblanks the screen.
60
61 --bfreq[=number]
62 Sets the bell frequency in Hertz. Without an argument, it defaults
63 to 0. Virtual consoles only.
64
65 --blength[=0-2000]
66 Sets the bell duration in milliseconds. Without an argument, it
67 defaults to 0. Virtual consoles only.
68
69 --blink on|off
70 Turns blink mode on or off. Except on a virtual console, --blink
71 off turns off all attributes (bold, half-brightness, blink,
72 reverse).
73
74 --bold on|off
75 urns bold (extra bright) mode on or off. Except on a virtual
76 console, --bold off turns off all attributes (bold,
77 half-brightness, blink, reverse).
78
79 --clear[=all|rest]
80 Without an argument or with the argument all, the entire screen is
81 cleared and the cursor is set to the home position, just like
82 clear(1) does. With the argument rest, the screen is cleared from
83 the current cursor position to the end.
84
85 --clrtabs[=tab1 tab2 tab3 ...]
86 Clears tab stops from the given horizontal cursor positions, in the
87 range 1-160. Without arguments, it clears all tab stops. Virtual
88 consoles only.
89
90 --cursor on|off
91 Turns the terminal’s cursor on or off.
92
93 --default
94 Sets the terminal’s rendering options to the default values.
95
96 --dump[=console_number]
97 Writes a snapshot of the virtual console with the given number to
98 the file specified with the --file option, overwriting its
99 contents; the default is screen.dump. Without an argument, it dumps
100 the current virtual console. This overrides --append.
101
102 --file filename
103 Sets the snapshot file name for any --dump or --append options on
104 the same command line. If this option is not present, the default
105 is screen.dump in the current directory. A path name that exceeds
106 the system maximum will be truncated, see PATH_MAX from
107 linux/limits.h for the value.
108
109 --foreground 8-color|default
110 Sets the foreground text color.
111
112 --half-bright on|off
113 Turns dim (half-brightness) mode on or off. Except on a virtual
114 console, --half-bright off turns off all attributes (bold,
115 half-brightness, blink, reverse).
116
117 --hbcolor [bright] 16-color
118 Sets the color for half-bright characters.
119
120 --initialize
121 Displays the terminal initialization string, which typically sets
122 the terminal’s rendering options, and other attributes to the
123 default values.
124
125 --inversescreen on|off
126 Swaps foreground and background colors for the whole screen.
127
128 --linewrap on|off
129 Makes the terminal continue on a new line when a line is full.
130
131 --msg on|off
132 Enables or disables the sending of kernel printk() messages to the
133 console. Virtual consoles only.
134
135 --msglevel 0-8
136 Sets the console logging level for kernel printk() messages. All
137 messages strictly more important than this will be printed, so a
138 logging level of 0 has the same effect as --msg on and a logging
139 level of 8 will print all kernel messages. klogd(8) may be a more
140 convenient interface to the logging of kernel messages.
141
142 Virtual consoles only.
143
144 --powerdown[=0-60]
145 Sets the VESA powerdown interval in minutes. Without an argument,
146 it defaults to 0 (disable powerdown). If the console is blanked or
147 the monitor is in suspend mode, then the monitor will go into vsync
148 suspend mode or powerdown mode respectively after this period of
149 time has elapsed.
150
151 --powersave mode
152 Valid values for mode are:
153
154 vsync|on
155 Puts the monitor into VESA vsync suspend mode.
156
157 hsync
158 Puts the monitor into VESA hsync suspend mode.
159
160 powerdown
161 Puts the monitor into VESA powerdown mode.
162
163 off
164 Turns monitor VESA powersaving features.
165
166 --regtabs[=1-160]
167 Clears all tab stops, then sets a regular tab stop pattern, with
168 one tab every specified number of positions. Without an argument,
169 it defaults to 8. Virtual consoles only.
170
171 --repeat on|off
172 Turns keyboard repeat on or off. Virtual consoles only.
173
174 --reset
175 Displays the terminal reset string, which typically resets the
176 terminal to its power-on state.
177
178 --resize
179 Reset terminal size by assessing maximum row and column. This is
180 useful when actual geometry and kernel terminal driver are not in
181 sync. Most notable use case is with serial consoles, that do not
182 use ioctl(3p) but just byte streams and breaks.
183
184 --reverse on|off
185 Turns reverse video mode on or off. Except on a virtual console,
186 --reverse off turns off all attributes (bold, half-brightness,
187 blink, reverse).
188
189 --store
190 Stores the terminal’s current rendering options (foreground and
191 background colors) as the values to be used at reset-to-default.
192 Virtual consoles only.
193
194 --tabs[=tab1 tab2 tab3 ...]
195 Sets tab stops at the given horizontal cursor positions, in the
196 range 1-160. Without arguments, it shows the current tab stop
197 settings.
198
199 --term terminal_name
200 Overrides the TERM environment variable.
201
202 --ulcolor [bright] 16-color
203 Sets the color for underlined characters. Virtual consoles only.
204
205 --underline on|off
206 Turns underline mode on or off.
207
208 --version
209 Displays version information and exits.
210
211 --help
212 Displays a help text and exits.
213
215 Since version 2.25 setterm has support for long options with two
216 hyphens, for example --help, beside the historical long options with a
217 single hyphen, for example -help. In scripts it is better to use the
218 backward-compatible single hyphen rather than the double hyphen.
219 Currently there are no plans nor good reasons to discontinue
220 single-hyphen compatibility.
221
223 Differences between the Minix and Linux versions are not documented.
224
226 stty(1), tput(1), tty(4), terminfo(5)
227
229 For bug reports, use the issue tracker at
230 https://github.com/karelzak/util-linux/issues.
231
233 The setterm command is part of the util-linux package which can be
234 downloaded from Linux Kernel Archive
235 <https://www.kernel.org/pub/linux/utils/util-linux/>.
236
237
238
239util-linux 2.37.2 2021-06-02 SETTERM(1)