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