]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/vt.4
Sync to HEAD@r271160.
[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 July 2, 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.spclkeys=15
49 .Sh DESCRIPTION
50 The
51 .Nm
52 device provides multiple virtual terminals with an extensive feature
53 set:
54 .Bl -item -offset indent
55 .It
56 Unicode UTF-8 text with double-width characters.
57 .It
58 Large font maps in graphics mode, including support for Asian
59 character sets.
60 .It
61 Graphics-mode consoles.
62 .It
63 Integration with
64 KMS
65 .Pq Kernel Mode Setting
66 video drivers for switching between the
67 .Em X Window System
68 and virtual terminals.
69 .El
70 .Ss Virtual Terminals
71 Multiple virtual terminals are provided on a single computer.
72 Up to sixteen virtual terminals can be defined.
73 A single virtual terminal is connected to the screen and keyboard
74 at a time.
75 Key combinations are used to select a virtual terminal.
76 Alt-F1 through Alt-F12 correspond to the first twelve virtual terminals.
77 If more than twelve virtual terminals are created, Shift-Alt-F1 through
78 Shift-Alt-F4 are used to switch to the additional terminals.
79 .Ss Copying and Pasting Text with a Mouse
80 Copying and pasting text from the screen with a mouse is supported.
81 Press and hold down mouse button 1, usually the left button, while
82 moving the mouse to select text.
83 Selected text is highlighted with reversed foreground and background
84 colors.
85 To select more text after releasing mouse button 1, press mouse button
86 3, usually the right button.
87 To paste text that has been selected, press mouse button 2, usually the
88 middle button.
89 The text is entered as if it were typed at the keyboard.
90 The
91 .Dv VT_TWOBUTTON_MOUSE
92 kernel option can be used with mice that only have two buttons.
93 Setting this option makes the second mouse button into the
94 paste button.
95 See
96 .Xr moused 8
97 for more information.
98 .Ss Scrolling Back
99 Output that has scrolled off the screen can be reviewed by pressing the
100 Scroll Lock key, then scrolling up and down with the arrow keys.
101 The Page Up and Page Down keys scroll up or down a full screen at a
102 time.
103 The Home and End keys jump to the beginning or end of the scrollback
104 buffer.
105 When finished reviewing, press the Scroll Lock key again to return to
106 normal use.
107 .Sh DRIVER CONFIGURATION
108 .Ss Kernel Configuration Options
109 These kernel options control the
110 .Nm
111 driver.
112 .Bl -tag -width MAXCONS
113 .It Dv TERMINAL_NORM_ATTR= Ns Pa attribute
114 .It Dv TERMINAL_KERN_ATTR= Ns Pa attribute
115 These options allow changing the default colors used for normal and kernel
116 text.
117 Available colors are defined in
118 .In sys/terminal.h .
119 See
120 .Sx EXAMPLES
121 below.
122 .It Dv VT_MAXWINDOWS=N
123 Set the number of virtual terminals to be created to
124 .Fa N .
125 The value defaults to 12.
126 .It Dv VT_ALT_TO_ESC_HACK=1
127 When the Alt key is held down while pressing another key, send an ESC
128 sequence instead of the Alt key.
129 .It Dv VT_TWOBUTTON_MOUSE
130 If defined, swap the functions of mouse buttons 2 and 3.
131 In effect, this makes the right-hand mouse button perform a paste.
132 These options are checked in the order shown.
133 .It Dv SC_NO_CUTPASTE
134 Disable mouse support.
135 .It VT_FB_DEFAULT_WIDTH=X
136 Set the default width to
137 .Fa X .
138 .It VT_FB_DEFAULT_HEIGHT=Y
139 Set the default height to
140 .Fa Y .
141 .El
142 .Sh BACKWARDS COMPATIBILITY
143 Several options are provided for compatibility with the previous
144 console device,
145 .Xr sc 4 .
146 These options will be removed in a future
147 .Fx
148 version.
149 .Bl -column -offset indent ".Sy vt VT_TWOBUTTON_MOUSE" ".Sy SC_TWOBUTTON_MOUSE"
150 .It Sy vt Option Name Ta Sy sc Option Name
151 .It Dv TERMINAL_KERN_ATTR Ta Dv SC_KERNEL_CONS_ATTR
152 .It Dv TERMINAL_NORM_ATTR Ta Dv SC_NORM_ATTR
153 .It Dv VT_TWOBUTTON_MOUSE Ta Dv SC_TWOBUTTON_MOUSE
154 .It Dv VT_MAXWINDOWS Ta Dv MAXCONS
155 .It none Ta Dv SC_NO_CUTPASTE
156 .El
157 .Sh START-UP OPERATION WITH X86 BIOS SYSTEMS
158 The computer BIOS starts in text mode, and
159 the
160 .Fx
161 .Xr loader 8
162 runs, loading the kernel.
163 If
164 .Va hw.vga.textmode
165 is set, the system remains in text mode.
166 Otherwise,
167 .Nm
168 switches to 640x480x16 VGA mode using
169 .Cm vt_vga .
170 If a KMS
171 .Pq Kernel Mode Switching
172 video driver is available, the display is switched to high resolution
173 and the KMS driver takes over.
174 When a KMS driver is not available,
175 .Cm vt_vga
176 remains active.
177 .Sh LOADER TUNABLES
178 These settings can be entered at the
179 .Xr loader 8
180 prompt or in
181 .Xr loader.conf 5 .
182 .Bl -tag -width indent
183 .It Va hw.vga.textmode
184 Set to 1 to use virtual terminals in text mode instead of graphics mode.
185 Features that require graphics mode, like loadable fonts, will be
186 disabled.
187 .It Va kern.vty
188 When both
189 .Nm
190 and
191 .Xr sc 4 have been compiled into the kernel, the one to use for the
192 system console can be selected by setting this value to
193 .Ql vt
194 or
195 .Ql sc .
196 If this value is not set,
197 .Xr sc 4
198 is used.
199 .It Va kern.vt.spclkeys
200 bitmap of allowed special keys. 1 is enabled, 0 is disabled. Encoded as:
201 .Bl -tag -compact -width 0x000000
202 .It 0x0001
203 Debug request key combination. (Ctrl+Alt+Esc)
204 .It 0x0002
205 Reboot. (Ctrl+Alt+Del)
206 .It 0x0004
207 Halt.
208 .It 0x0008
209 Power down.
210 .El
211 Default is 15, all enabled.
212 .El
213 .Sh FILES
214 .Bl -tag -width /usr/share/vt/keymaps/* -compact
215 .It Pa /dev/console
216 .It Pa /dev/consolectl
217 .It Pa /dev/ttyv*
218 virtual terminals
219 .It Pa /etc/ttys
220 terminal initialization information
221 .It Pa /usr/share/vt/fonts/*.fnt
222 console fonts
223 .It Pa /usr/share/vt/keymaps/*.kbd
224 keyboard layouts
225 .El
226 .Sh EXAMPLES
227 This example changes the default color of normal text to green on a
228 black background, or black on a green background when reversed.
229 Note that white space cannot be used inside the attribute string
230 because of the current implementation of
231 .Xr config 8 .
232 .Pp
233 .Dl "options TERMINAL_NORM_ATTR=(FG_GREEN|BG_BLACK)"
234 .Pp
235 This line changes the default color of kernel messages to be bright red
236 on a black background, or black on a bright red background when reversed.
237 .Pp
238 .Dl "options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK)"
239 .Sh SEE ALSO
240 .Xr kbdcontrol 1 ,
241 .Xr login 1 ,
242 .Xr vidcontrol 1 ,
243 .Xr atkbd 4 ,
244 .Xr atkbdc 4 ,
245 .Xr keyboard 4 ,
246 .Xr screen 4 ,
247 .Xr splash 4 ,
248 .Xr syscons 4 ,
249 .Xr ukbd 4 ,
250 .Xr kbdmap 5 ,
251 .Xr rc.conf 5 ,
252 .Xr ttys 5 ,
253 .Xr config 8 ,
254 .Xr getty 8 ,
255 .Xr kbdmux 8 ,
256 .Xr kldload 8 ,
257 .Xr moused 8
258 .Sh HISTORY
259 The
260 .Nm
261 driver first appeared in
262 .Fx 9.3 .
263 .Sh AUTHORS
264 .An -nosplit
265 The
266 .Nm
267 device driver was developed by
268 .An Ed Schouten Aq Mt ed@FreeBSD.org ,
269 .An Ed Maste Aq Mt emaste@FreeBSD.org ,
270 and
271 .An Aleksandr Rybalko Aq Mt ray@FreeBSD.org ,
272 with sponsorship provided by the
273 .Fx
274 Foundation.
275 This manual page was written by
276 .An Warren Block Aq Mt wblock@FreeBSD.org .
277 .Sh CAVEATS
278 Paste buffer size is limited by the system value
279 .Brq Dv MAX_INPUT ,
280 the number of bytes that can be stored in the terminal
281 input queue, usually 1024 bytes
282 (see
283 .Xr termios 4 ) .