]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/vt.4
MFC r361792:
[FreeBSD/FreeBSD.git] / share / man / man4 / vt.4
1 .\" Copyright (c) 2014 Warren Block
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd June 4, 2020
28 .Dt "VT" 4
29 .Os
30 .Sh NAME
31 .Nm vt
32 .Nd virtual terminal console driver
33 .Sh SYNOPSIS
34 .Cd "options TERMINAL_KERN_ATTR=_attribute_"
35 .Cd "options TERMINAL_NORM_ATTR=_attribute_"
36 .Cd "options VT_MAXWINDOWS=N"
37 .Cd "options VT_ALT_TO_ESC_HACK=1"
38 .Cd "options VT_TWOBUTTON_MOUSE"
39 .Cd "options VT_FB_MAX_WIDTH=X"
40 .Cd "options VT_FB_MAX_HEIGHT=Y"
41 .Cd "options SC_NO_CUTPASTE"
42 .Cd "device vt"
43 .Pp
44 In
45 .Xr loader.conf 5 :
46 .Cd hw.vga.textmode=1
47 .Cd hw.vga.acpi_ignore_no_vga=1
48 .Cd kern.vty=vt
49 .Cd kern.vt.color.<colornum>.rgb="<colorspec>"
50 .Cd kern.vt.fb.default_mode="<X>x<Y>"
51 .Cd kern.vt.fb.modes.<connector>="<X>x<Y>"
52 .Pp
53 In
54 .Xr loader.conf 5 or
55 .Xr sysctl.conf 5 :
56 .Cd kern.vt.kbd_halt=1
57 .Cd kern.vt.kbd_poweroff=1
58 .Cd kern.vt.kbd_reboot=1
59 .Cd kern.vt.kbd_debug=1
60 .Cd kern.vt.kbd_panic=0
61 .Cd kern.vt.enable_bell=1
62 .Sh DESCRIPTION
63 The
64 .Nm
65 device provides multiple virtual terminals with an extensive feature
66 set:
67 .Bl -item -offset indent
68 .It
69 Unicode UTF-8 text with double-width characters.
70 .It
71 Large font maps in graphics mode, including support for Asian
72 character sets.
73 .It
74 Graphics-mode consoles.
75 .It
76 Integration with
77 KMS
78 .Pq Kernel Mode Setting
79 video drivers for switching between the
80 .Em X Window System
81 and virtual terminals.
82 .El
83 .Ss Virtual Terminals
84 Multiple virtual terminals are provided on a single computer.
85 Up to sixteen virtual terminals can be defined.
86 A single virtual terminal is connected to the screen and keyboard
87 at a time.
88 Key combinations are used to select a virtual terminal.
89 Alt-F1 through Alt-F12 correspond to the first twelve virtual terminals.
90 If more than twelve virtual terminals are created, Shift-Alt-F1 through
91 Shift-Alt-F4 are used to switch to the additional terminals.
92 .Ss Copying and Pasting Text with a Mouse
93 Copying and pasting text from the screen with a mouse is supported.
94 Press and hold down mouse button 1, usually the left button, while
95 moving the mouse to select text.
96 Selected text is highlighted with reversed foreground and background
97 colors.
98 To select more text after releasing mouse button 1, press mouse button
99 3, usually the right button.
100 To paste text that has been selected, press mouse button 2, usually the
101 middle button.
102 The text is entered as if it were typed at the keyboard.
103 The
104 .Dv VT_TWOBUTTON_MOUSE
105 kernel option can be used with mice that only have two buttons.
106 Setting this option makes the second mouse button into the
107 paste button.
108 See
109 .Xr moused 8
110 for more information.
111 .Ss Scrolling Back
112 Output that has scrolled off the screen can be reviewed by pressing the
113 Scroll Lock key, then scrolling up and down with the arrow keys.
114 The Page Up and Page Down keys scroll up or down a full screen at a
115 time.
116 The Home and End keys jump to the beginning or end of the scrollback
117 buffer.
118 When finished reviewing, press the Scroll Lock key again to return to
119 normal use.
120 .Sh DRIVER CONFIGURATION
121 .Ss Kernel Configuration Options
122 These kernel options control the
123 .Nm
124 driver.
125 .Bl -tag -width MAXCONS
126 .It Dv TERMINAL_NORM_ATTR= Ns Pa attribute
127 .It Dv TERMINAL_KERN_ATTR= Ns Pa attribute
128 These options change the default colors used for normal and kernel
129 text.
130 Available colors are defined in
131 .In sys/terminal.h .
132 See
133 .Sx EXAMPLES
134 below.
135 .It Dv VT_MAXWINDOWS=N
136 Set the number of virtual terminals to be created to
137 .Fa N .
138 The value defaults to 12.
139 .It Dv VT_ALT_TO_ESC_HACK=1
140 When the Alt key is held down while pressing another key, send an ESC
141 sequence instead of the Alt key.
142 .It Dv VT_TWOBUTTON_MOUSE
143 If defined, swap the functions of mouse buttons 2 and 3.
144 In effect, this makes the right-hand mouse button perform a paste.
145 These options are checked in the order shown.
146 .It Dv SC_NO_CUTPASTE
147 Disable mouse support.
148 .It VT_FB_MAX_WIDTH=X
149 Set the maximum width to
150 .Fa X .
151 .It VT_FB_MAX_HEIGHT=Y
152 Set the maximum height to
153 .Fa Y .
154 .El
155 .Sh BACKWARDS COMPATIBILITY
156 Several options are provided for compatibility with the previous
157 console device,
158 .Xr sc 4 .
159 These options will be removed in a future
160 .Fx
161 version.
162 .Bl -column -offset indent ".Sy vt VT_TWOBUTTON_MOUSE" ".Sy SC_TWOBUTTON_MOUSE"
163 .It Sy vt Option Name Ta Sy sc Option Name
164 .It Dv TERMINAL_KERN_ATTR Ta Dv SC_KERNEL_CONS_ATTR
165 .It Dv TERMINAL_NORM_ATTR Ta Dv SC_NORM_ATTR
166 .It Dv VT_TWOBUTTON_MOUSE Ta Dv SC_TWOBUTTON_MOUSE
167 .It Dv VT_MAXWINDOWS Ta Dv MAXCONS
168 .It none Ta Dv SC_NO_CUTPASTE
169 .El
170 .Sh START-UP OPERATION WITH X86 BIOS SYSTEMS
171 The computer BIOS starts in text mode, and
172 the
173 .Fx
174 .Xr loader 8
175 runs, loading the kernel.
176 If
177 .Va hw.vga.textmode
178 is set, the system remains in text mode.
179 Otherwise,
180 .Nm
181 switches to 640x480x16 VGA mode using
182 .Cm vt_vga .
183 If a KMS
184 .Pq Kernel Mode Setting
185 video driver is available, the display is switched to high resolution
186 and the KMS driver takes over.
187 When a KMS driver is not available,
188 .Cm vt_vga
189 remains active.
190 .Sh LOADER TUNABLES
191 These settings can be entered at the
192 .Xr loader 8
193 prompt or in
194 .Xr loader.conf 5 .
195 .Bl -tag -width indent
196 .It Va hw.vga.textmode
197 Set to 1 to use virtual terminals in text mode instead of graphics mode.
198 Features that require graphics mode, like loadable fonts, will be
199 disabled.
200 .It Va hw.vga.acpi_ignore_no_vga
201 Set to 1 to force the usage of the VGA driver regardless of whether
202 ACPI IAPC_BOOT_ARCH signals no VGA support.
203 Can be used to workaround firmware bugs in the ACPI tables.
204 .It Va kern.vty
205 Set this value to
206 .Ql vt
207 or
208 .Ql sc
209 to choose a specific system console, overriding the default.
210 The
211 .Pa GENERIC
212 kernel uses
213 .Nm
214 when this value is not set.
215 .It Va kern.vt.color. Ns Ar colornum Ns Va .rgb
216 Set this value to override default palette entry for color
217 .Pa colornum
218 which should be in a range from 0 to 15 inclusive.
219 The value should be either a comma-separated triplet of
220 red, green, and blue values in a range from 0 to 255 or
221 HTML-like hex triplet.
222 See
223 .Sx EXAMPLES
224 below.
225 .It Va kern.vt.fb.default_mode
226 Set this value to a graphic mode to override the default mode picked by the
227 .Nm
228 backend.
229 The mode is applied to all output connectors.
230 This is currently only supported by the
231 .Cm vt_fb
232 backend when it is paired with a KMS video driver.
233 .It Va kern.vt.fb.modes. Ns Pa connector_name
234 Set this value to a graphic mode to override the default mode picked by the
235 .Nm
236 backend.
237 This mode is applied to the output connector
238 .Pa connector_name
239 only.
240 It has precedence over
241 .Va kern.vt.fb.default_mode .
242 The names of available connector names can be found in
243 .Xr dmesg 8
244 after loading the KMS driver.
245 It will contain a list of connectors and their associated tunables.
246 This is currently only supported by the
247 .Cm vt_fb
248 backend when it is paired with a KMS video driver.
249 .El
250 .Sh KEYBOARD SYSCTL TUNABLES
251 These settings control whether certain special key combinations are enabled or
252 ignored.
253 The specific key combinations can be configured by using a
254 .Xr keymap 5
255 file.
256 .Pp
257 These settings can be entered at the
258 .Xr loader 8
259 prompt or in
260 .Xr loader.conf 5
261 and can also be changed at runtime with the
262 .Xr sysctl 8
263 command.
264 .Bl -tag -width indent
265 .It Va kern.vt.kbd_halt
266 Enable halt keyboard combination.
267 .It Va kern.vt.kbd_poweroff
268 Enable power off key combination.
269 .It Va kern.vt.kbd_reboot
270 Enable reboot key combination, usually Ctrl+Alt+Del.
271 .It Va kern.vt.kbd_debug
272 Enable debug request key combination, usually Ctrl+Alt+Esc.
273 .It Va kern.vt.kbd_panic
274 Enable panic key combination.
275 .El
276 .Sh OTHER SYSCTL TUNABLES
277 These settings can be entered at the
278 .Xr loader 8
279 prompt, set in
280 .Xr loader.conf 5 ,
281 or changed at runtime with
282 .Xr sysctl 8 .
283 .Bl -tag -width indent
284 .It Va kern.vt.enable_bell
285 Enable the terminal bell.
286 .El
287 .Sh FILES
288 .Bl -tag -width /usr/share/vt/keymaps/* -compact
289 .It Pa /dev/console
290 .It Pa /dev/consolectl
291 .It Pa /dev/ttyv*
292 virtual terminals
293 .It Pa /etc/ttys
294 terminal initialization information
295 .It Pa /usr/share/vt/fonts/*.fnt
296 console fonts
297 .It Pa /usr/share/vt/keymaps/*.kbd
298 keyboard layouts
299 .El
300 .Sh EXAMPLES
301 This example changes the default color of normal text to green on a
302 black background, or black on a green background when reversed.
303 Note that white space cannot be used inside the attribute string
304 because of the current implementation of
305 .Xr config 8 .
306 .Pp
307 .Dl "options TERMINAL_NORM_ATTR=(FG_GREEN|BG_BLACK)"
308 .Pp
309 This line changes the default color of kernel messages to be bright red
310 on a black background, or black on a bright red background when reversed.
311 .Pp
312 .Dl "options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK)"
313 .Pp
314 To set a 1024x768 mode on all output connectors, put the following line in
315 .Pa /boot/loader.conf :
316 .Pp
317 .Dl kern.vt.fb.default_mode="1024x768"
318 .Pp
319 To set a 800x600 only on a laptop builtin screen, use the following line instead:
320 .Pp
321 .Dl kern.vt.fb.modes.LVDS-1="800x600"
322 .Pp
323 The connector name was found in
324 .Xr dmesg 8 :
325 .Pp
326 .Dl info: [drm] Connector LVDS-1: get mode from tunables:
327 .Dl info: [drm]   - kern.vt.fb.modes.LVDS-1
328 .Dl info: [drm]   - kern.vt.fb.default_mode
329 .Pp
330 To set black and white colors of console palette
331 .Pp
332 .Dl kern.vt.color.0.rgb="10,10,10"
333 .Dl kern.vt.color.15.rgb="#f0f0f0"
334 .Sh SEE ALSO
335 .Xr kbdcontrol 1 ,
336 .Xr login 1 ,
337 .Xr vidcontrol 1 ,
338 .Xr atkbd 4 ,
339 .Xr atkbdc 4 ,
340 .Xr kbdmux 4 ,
341 .Xr keyboard 4 ,
342 .Xr screen 4 ,
343 .Xr splash 4 ,
344 .Xr syscons 4 ,
345 .Xr ukbd 4 ,
346 .Xr kbdmap 5 ,
347 .Xr rc.conf 5 ,
348 .Xr ttys 5 ,
349 .Xr config 8 ,
350 .Xr getty 8 ,
351 .Xr kldload 8 ,
352 .Xr moused 8 ,
353 .Xr vtfontcvt 8
354 .Sh HISTORY
355 The
356 .Nm
357 driver first appeared in
358 .Fx 9.3 .
359 .Sh AUTHORS
360 .An -nosplit
361 The
362 .Nm
363 device driver was developed by
364 .An \&Ed Schouten Aq Mt ed@FreeBSD.org ,
365 .An \&Ed Maste Aq Mt emaste@FreeBSD.org ,
366 and
367 .An Aleksandr Rybalko Aq Mt ray@FreeBSD.org ,
368 with sponsorship provided by the
369 .Fx
370 Foundation.
371 This manual page was written by
372 .An Warren Block Aq Mt wblock@FreeBSD.org .
373 .Sh CAVEATS
374 Paste buffer size is limited by the system value
375 .Brq Dv MAX_INPUT ,
376 the number of bytes that can be stored in the terminal
377 input queue, usually 1024 bytes
378 (see
379 .Xr termios 4 ) .