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