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