xref: /freebsd/share/man/man4/vt.4 (revision 345c0478adbd4517251b6966b32b4bf820c4cc6c)
1abebc22fSWarren Block.\" Copyright (c) 2014 Warren Block
2abebc22fSWarren Block.\" All rights reserved.
3abebc22fSWarren Block.\"
4abebc22fSWarren Block.\" Redistribution and use in source and binary forms, with or without
5abebc22fSWarren Block.\" modification, are permitted provided that the following conditions
6abebc22fSWarren Block.\" are met:
7abebc22fSWarren Block.\" 1. Redistributions of source code must retain the above copyright
8abebc22fSWarren Block.\"    notice, this list of conditions and the following disclaimer.
9abebc22fSWarren Block.\" 2. Redistributions in binary form must reproduce the above copyright
10abebc22fSWarren Block.\"    notice, this list of conditions and the following disclaimer in the
11abebc22fSWarren Block.\"    documentation and/or other materials provided with the distribution.
12abebc22fSWarren Block.\"
13abebc22fSWarren Block.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14abebc22fSWarren Block.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15abebc22fSWarren Block.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16abebc22fSWarren Block.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17abebc22fSWarren Block.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18abebc22fSWarren Block.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19abebc22fSWarren Block.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20abebc22fSWarren Block.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21abebc22fSWarren Block.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22abebc22fSWarren Block.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23abebc22fSWarren Block.\" SUCH DAMAGE.
24abebc22fSWarren Block.\"
25abebc22fSWarren Block.\" $FreeBSD$
26abebc22fSWarren Block.\"
275e819274SEd Maste.Dd October 20, 2014
283bff5e84SWarren Block.Dt "VIRTUAL TERMINALS" 4
29abebc22fSWarren Block.Os
30abebc22fSWarren Block.Sh NAME
31abebc22fSWarren Block.Nm vt
32abebc22fSWarren Block.Nd virtual terminal console driver
33abebc22fSWarren Block.Sh SYNOPSIS
347344ee18SMarius Strobl.Cd "options TERMINAL_KERN_ATTR=_attribute_"
357344ee18SMarius Strobl.Cd "options TERMINAL_NORM_ATTR=_attribute_"
36abebc22fSWarren Block.Cd "options VT_MAXWINDOWS=N"
37abebc22fSWarren Block.Cd "options VT_ALT_TO_ESC_HACK=1"
38abebc22fSWarren Block.Cd "options VT_TWOBUTTON_MOUSE"
39abebc22fSWarren Block.Cd "options VT_FB_DEFAULT_WIDTH=X"
40abebc22fSWarren Block.Cd "options VT_FB_DEFAULT_HEIGHT=Y"
41abebc22fSWarren Block.Cd "options SC_NO_CUTPASTE"
42abebc22fSWarren Block.Cd "device vt"
43abebc22fSWarren Block.Pp
44abebc22fSWarren BlockIn
45abebc22fSWarren Block.Xr loader.conf 5 :
46abebc22fSWarren Block.Cd hw.vga.textmode=1
4759644098SEd Maste.Cd kern.vty=vt
4879c4bda8SJean-Sébastien Pédron.Cd kern.vt.fb.default_mode="<X>x<Y>"
4979c4bda8SJean-Sébastien Pédron.Cd kern.vt.fb.modes.<connector>="<X>x<Y>"
50d98ae075SEd Maste.Pp
51d98ae075SEd MasteIn
52d98ae075SEd Maste.Xr loader.conf 5 or
53d98ae075SEd Maste.Xr sysctl.conf 5 :
54d98ae075SEd Maste.Cd kern.vt.kbd_halt=1
55d98ae075SEd Maste.Cd kern.vt.kbd_poweroff=1
56d98ae075SEd Maste.Cd kern.vt.kbd_reboot=1
57d98ae075SEd Maste.Cd kern.vt.kbd_debug=1
58d98ae075SEd Maste.Cd kern.vt.kbd_panic=0
59abebc22fSWarren Block.Sh DESCRIPTION
60abebc22fSWarren BlockThe
61abebc22fSWarren Block.Nm
62abebc22fSWarren Blockdevice provides multiple virtual terminals with an extensive feature
63abebc22fSWarren Blockset:
64abebc22fSWarren Block.Bl -item -offset indent
65abebc22fSWarren Block.It
66abebc22fSWarren BlockUnicode UTF-8 text with double-width characters.
67abebc22fSWarren Block.It
68abebc22fSWarren BlockLarge font maps in graphics mode, including support for Asian
69abebc22fSWarren Blockcharacter sets.
70abebc22fSWarren Block.It
71abebc22fSWarren BlockGraphics-mode consoles.
72abebc22fSWarren Block.It
73abebc22fSWarren BlockIntegration with
74abebc22fSWarren BlockKMS
75abebc22fSWarren Block.Pq Kernel Mode Setting
76abebc22fSWarren Blockvideo drivers for switching between the
77abebc22fSWarren Block.Em X Window System
78abebc22fSWarren Blockand virtual terminals.
79abebc22fSWarren Block.El
80abebc22fSWarren Block.Ss Virtual Terminals
81abebc22fSWarren BlockMultiple virtual terminals are provided on a single computer.
82abebc22fSWarren BlockUp to sixteen virtual terminals can be defined.
83abebc22fSWarren BlockA single virtual terminal is connected to the screen and keyboard
84abebc22fSWarren Blockat a time.
85abebc22fSWarren BlockKey combinations are used to select a virtual terminal.
86abebc22fSWarren BlockAlt-F1 through Alt-F12 correspond to the first twelve virtual terminals.
87abebc22fSWarren BlockIf more than twelve virtual terminals are created, Shift-Alt-F1 through
88abebc22fSWarren BlockShift-Alt-F4 are used to switch to the additional terminals.
89abebc22fSWarren Block.Ss Copying and Pasting Text with a Mouse
90abebc22fSWarren BlockCopying and pasting text from the screen with a mouse is supported.
91abebc22fSWarren BlockPress and hold down mouse button 1, usually the left button, while
92abebc22fSWarren Blockmoving the mouse to select text.
93abebc22fSWarren BlockSelected text is highlighted with reversed foreground and background
94abebc22fSWarren Blockcolors.
95abebc22fSWarren BlockTo select more text after releasing mouse button 1, press mouse button
96abebc22fSWarren Block3, usually the right button.
97abebc22fSWarren BlockTo paste text that has been selected, press mouse button 2, usually the
98abebc22fSWarren Blockmiddle button.
99abebc22fSWarren BlockThe text is entered as if it were typed at the keyboard.
100abebc22fSWarren BlockThe
101abebc22fSWarren Block.Dv VT_TWOBUTTON_MOUSE
102abebc22fSWarren Blockkernel option can be used with mice that only have two buttons.
103abebc22fSWarren BlockSetting this option makes the second mouse button into the
104abebc22fSWarren Blockpaste button.
105abebc22fSWarren BlockSee
106abebc22fSWarren Block.Xr moused 8
107abebc22fSWarren Blockfor more information.
108abebc22fSWarren Block.Ss Scrolling Back
109abebc22fSWarren BlockOutput that has scrolled off the screen can be reviewed by pressing the
110abebc22fSWarren BlockScroll Lock key, then scrolling up and down with the arrow keys.
111abebc22fSWarren BlockThe Page Up and Page Down keys scroll up or down a full screen at a
112abebc22fSWarren Blocktime.
113abebc22fSWarren BlockThe Home and End keys jump to the beginning or end of the scrollback
114abebc22fSWarren Blockbuffer.
115abebc22fSWarren BlockWhen finished reviewing, press the Scroll Lock key again to return to
116abebc22fSWarren Blocknormal use.
117abebc22fSWarren Block.Sh DRIVER CONFIGURATION
118abebc22fSWarren Block.Ss Kernel Configuration Options
119abebc22fSWarren BlockThese kernel options control the
120abebc22fSWarren Block.Nm
121abebc22fSWarren Blockdriver.
122abebc22fSWarren Block.Bl -tag -width MAXCONS
1238329214dSWarren Block.It Dv TERMINAL_NORM_ATTR= Ns Pa attribute
1248329214dSWarren Block.It Dv TERMINAL_KERN_ATTR= Ns Pa attribute
1258329214dSWarren BlockThese options allow changing the default colors used for normal and kernel
1268329214dSWarren Blocktext.
1277344ee18SMarius StroblAvailable colors are defined in
1287344ee18SMarius Strobl.In sys/terminal.h .
1297344ee18SMarius StroblSee
1307344ee18SMarius Strobl.Sx EXAMPLES
1317344ee18SMarius Stroblbelow.
132abebc22fSWarren Block.It Dv VT_MAXWINDOWS=N
133abebc22fSWarren BlockSet the number of virtual terminals to be created to
134abebc22fSWarren Block.Fa N .
135abebc22fSWarren BlockThe value defaults to 12.
136abebc22fSWarren Block.It Dv VT_ALT_TO_ESC_HACK=1
137abebc22fSWarren BlockWhen the Alt key is held down while pressing another key, send an ESC
138abebc22fSWarren Blocksequence instead of the Alt key.
139abebc22fSWarren Block.It Dv VT_TWOBUTTON_MOUSE
140abebc22fSWarren BlockIf defined, swap the functions of mouse buttons 2 and 3.
141abebc22fSWarren BlockIn effect, this makes the right-hand mouse button perform a paste.
142abebc22fSWarren BlockThese options are checked in the order shown.
143abebc22fSWarren Block.It Dv SC_NO_CUTPASTE
144abebc22fSWarren BlockDisable mouse support.
145abebc22fSWarren Block.It VT_FB_DEFAULT_WIDTH=X
146abebc22fSWarren BlockSet the default width to
147abebc22fSWarren Block.Fa X .
148abebc22fSWarren Block.It VT_FB_DEFAULT_HEIGHT=Y
149abebc22fSWarren BlockSet the default height to
150abebc22fSWarren Block.Fa Y .
151abebc22fSWarren Block.El
152abebc22fSWarren Block.Sh BACKWARDS COMPATIBILITY
153abebc22fSWarren BlockSeveral options are provided for compatibility with the previous
154abebc22fSWarren Blockconsole device,
155abebc22fSWarren Block.Xr sc 4 .
156abebc22fSWarren BlockThese options will be removed in a future
157abebc22fSWarren Block.Fx
158abebc22fSWarren Blockversion.
159abebc22fSWarren Block.Bl -column -offset indent ".Sy vt VT_TWOBUTTON_MOUSE" ".Sy SC_TWOBUTTON_MOUSE"
160abebc22fSWarren Block.It Sy vt Option Name Ta Sy sc Option Name
1617344ee18SMarius Strobl.It Dv TERMINAL_KERN_ATTR Ta Dv SC_KERNEL_CONS_ATTR
1627344ee18SMarius Strobl.It Dv TERMINAL_NORM_ATTR Ta Dv SC_NORM_ATTR
163abebc22fSWarren Block.It Dv VT_TWOBUTTON_MOUSE Ta Dv SC_TWOBUTTON_MOUSE
164abebc22fSWarren Block.It Dv VT_MAXWINDOWS Ta Dv MAXCONS
165abebc22fSWarren Block.It none Ta Dv SC_NO_CUTPASTE
166abebc22fSWarren Block.El
167abebc22fSWarren Block.Sh START-UP OPERATION WITH X86 BIOS SYSTEMS
168abebc22fSWarren BlockThe computer BIOS starts in text mode, and
169abebc22fSWarren Blockthe
170abebc22fSWarren Block.Fx
171abebc22fSWarren Block.Xr loader 8
172abebc22fSWarren Blockruns, loading the kernel.
173abebc22fSWarren BlockIf
174abebc22fSWarren Block.Va hw.vga.textmode
175abebc22fSWarren Blockis set, the system remains in text mode.
176abebc22fSWarren BlockOtherwise,
177abebc22fSWarren Block.Nm
178abebc22fSWarren Blockswitches to 640x480x16 VGA mode using
1798329214dSWarren Block.Cm vt_vga .
180abebc22fSWarren BlockIf a KMS
18179c4bda8SJean-Sébastien Pédron.Pq Kernel Mode Setting
182abebc22fSWarren Blockvideo driver is available, the display is switched to high resolution
183abebc22fSWarren Blockand the KMS driver takes over.
184abebc22fSWarren BlockWhen a KMS driver is not available,
1858329214dSWarren Block.Cm vt_vga
186abebc22fSWarren Blockremains active.
187abebc22fSWarren Block.Sh LOADER TUNABLES
188abebc22fSWarren BlockThese settings can be entered at the
189abebc22fSWarren Block.Xr loader 8
190abebc22fSWarren Blockprompt or in
191abebc22fSWarren Block.Xr loader.conf 5 .
192abebc22fSWarren Block.Bl -tag -width indent
193abebc22fSWarren Block.It Va hw.vga.textmode
194abebc22fSWarren BlockSet to 1 to use virtual terminals in text mode instead of graphics mode.
195abebc22fSWarren BlockFeatures that require graphics mode, like loadable fonts, will be
196abebc22fSWarren Blockdisabled.
19759644098SEd Maste.It Va kern.vty
198d98ae075SEd MasteSet this value to
1998329214dSWarren Block.Ql vt
2008329214dSWarren Blockor
201d98ae075SEd Maste.Ql sc
202d98ae075SEd Masteto override the default driver used for the system console.
203d98ae075SEd MasteBy default,
2048329214dSWarren Block.Xr sc 4
205d98ae075SEd Masteis used on computers that boot from BIOS, and
206d98ae075SEd Maste.Nm
207d98ae075SEd Masteis used on computers that boot from UEFI.
20879c4bda8SJean-Sébastien Pédron.It Va kern.vt.fb.default_mode
20979c4bda8SJean-Sébastien PédronSet this value to a graphic mode to override the default mode picked by the
21079c4bda8SJean-Sébastien Pédron.Nm
2114261dbcfSJean-Sébastien Pédronbackend.
2124261dbcfSJean-Sébastien PédronThe mode is applied to all output connectors.
2134261dbcfSJean-Sébastien PédronThis is currently only supported by the
21479c4bda8SJean-Sébastien Pédron.Cm vt_fb
21579c4bda8SJean-Sébastien Pédronbackend when it's paired with a KMS video driver.
21679c4bda8SJean-Sébastien Pédron.It Va kern.vt.fb.modes. Ns Pa connector_name
21779c4bda8SJean-Sébastien PédronSet this value to a graphic mode to override the default mode picked by the
21879c4bda8SJean-Sébastien Pédron.Nm
2194261dbcfSJean-Sébastien Pédronbackend.
2204261dbcfSJean-Sébastien PédronThis mode is applied to the output connector
22179c4bda8SJean-Sébastien Pédron.Pa connector_name
22279c4bda8SJean-Sébastien Pédrononly. It has precedence over
22379c4bda8SJean-Sébastien Pédron.Va kern.vt.fb.default_mode .
224a95c4612SJean-Sébastien PédronThe names of available connector names can be found in
225a95c4612SJean-Sébastien Pédron.Xr dmesg 8
2264261dbcfSJean-Sébastien Pédronafter loading the KMS driver.
2274261dbcfSJean-Sébastien PédronIt will contain a list of connectors and their associated tunables.
2284261dbcfSJean-Sébastien PédronThis is currently only supported by the
22979c4bda8SJean-Sébastien Pédron.Cm vt_fb
23079c4bda8SJean-Sébastien Pédronbackend when it's paired with a KMS video driver.
23179c4bda8SJean-Sébastien Pédron.El
232d98ae075SEd Maste.Sh KEYBOARD SYSCTL TUNABLES
233d98ae075SEd MasteThese settings control whether certain special key combinations are enabled or
234d98ae075SEd Masteignored.
235d98ae075SEd MasteThe specific key combinations can be configured by using a
236d98ae075SEd Maste.Xr keymap 5
237d98ae075SEd Mastefile.
238d98ae075SEd Maste.Pp
239d98ae075SEd MasteThese settings can be entered at the
240d98ae075SEd Maste.Xr loader 8
241d98ae075SEd Masteprompt or in
242d98ae075SEd Maste.Xr loader.conf 5
243d98ae075SEd Masteand can also be changed at runtime with the
244d98ae075SEd Maste.Xr sysctl 8
245d98ae075SEd Mastecommand.
246d98ae075SEd Maste.Bl -tag -width indent
247d98ae075SEd Maste.It Va kern.vt.kbd_halt
248d98ae075SEd MasteEnable halt keyboard combination.
249d98ae075SEd Maste.It Va kern.vt.kbd_poweroff
250d98ae075SEd MasteEnable power off key combination.
251d98ae075SEd Maste.It Va kern.vt.kbd_reboot.
252d98ae075SEd MasteEnable reboot key combination, usually Ctrl+Alt+Del.
253d98ae075SEd Maste.It Va kern.vt.kbd_debug
254d98ae075SEd MasteEnable debug request key combination, usually Ctrl+Alt+Esc.
255d98ae075SEd Maste.It Va kern.vt.kbd_panic
256d98ae075SEd MasteEnable panic key combination.
257abebc22fSWarren Block.El
258abebc22fSWarren Block.Sh FILES
259651045d6SStefan Eßer.Bl -tag -width /usr/share/vt/keymaps/* -compact
260abebc22fSWarren Block.It Pa /dev/console
261abebc22fSWarren Block.It Pa /dev/consolectl
262abebc22fSWarren Block.It Pa /dev/ttyv*
263abebc22fSWarren Blockvirtual terminals
264abebc22fSWarren Block.It Pa /etc/ttys
265abebc22fSWarren Blockterminal initialization information
266651045d6SStefan Eßer.It Pa /usr/share/vt/fonts/*.fnt
267651045d6SStefan Eßerconsole fonts
268651045d6SStefan Eßer.It Pa /usr/share/vt/keymaps/*.kbd
269651045d6SStefan Eßerkeyboard layouts
270abebc22fSWarren Block.El
2718329214dSWarren Block.Sh EXAMPLES
2728329214dSWarren BlockThis example changes the default color of normal text to green on a
2738329214dSWarren Blockblack background, or black on a green background when reversed.
2748329214dSWarren BlockNote that white space cannot be used inside the attribute string
2758329214dSWarren Blockbecause of the current implementation of
2768329214dSWarren Block.Xr config 8 .
2778329214dSWarren Block.Pp
2788329214dSWarren Block.Dl "options TERMINAL_NORM_ATTR=(FG_GREEN|BG_BLACK)"
2798329214dSWarren Block.Pp
2808329214dSWarren BlockThis line changes the default color of kernel messages to be bright red
2818329214dSWarren Blockon a black background, or black on a bright red background when reversed.
2828329214dSWarren Block.Pp
2838329214dSWarren Block.Dl "options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK)"
28479c4bda8SJean-Sébastien Pédron.Pp
28579c4bda8SJean-Sébastien PédronTo set a 1024x768 mode on all output connectors, put the following line in
28679c4bda8SJean-Sébastien Pédron.Pa /boot/loader.conf :
28779c4bda8SJean-Sébastien Pédron.Pp
28879c4bda8SJean-Sébastien Pédron.Dl kern.vt.fb.default_mode="1024x768"
28979c4bda8SJean-Sébastien Pédron.Pp
29079c4bda8SJean-Sébastien PédronTo set a 800x600 only on a laptop builtin screen, use the following line instead:
29179c4bda8SJean-Sébastien Pédron.Pp
29279c4bda8SJean-Sébastien Pédron.Dl kern.vt.fb.modes.LVDS-1="800x600"
29379c4bda8SJean-Sébastien Pédron.Pp
29479c4bda8SJean-Sébastien PédronThe connector name was found in
29579c4bda8SJean-Sébastien Pédron.Xr dmesg 8 :
29679c4bda8SJean-Sébastien Pédron.Pp
29779c4bda8SJean-Sébastien Pédron.Dl info: [drm] Connector LVDS-1: get mode from tunables:
29879c4bda8SJean-Sébastien Pédron.Dl info: [drm]   - kern.vt.fb.modes.LVDS-1
29979c4bda8SJean-Sébastien Pédron.Dl info: [drm]   - kern.vt.fb.default_mode
300abebc22fSWarren Block.Sh SEE ALSO
301abebc22fSWarren Block.Xr kbdcontrol 1 ,
302abebc22fSWarren Block.Xr login 1 ,
303abebc22fSWarren Block.Xr vidcontrol 1 ,
304abebc22fSWarren Block.Xr atkbd 4 ,
305abebc22fSWarren Block.Xr atkbdc 4 ,
306*345c0478SEdward Tomasz Napierala.Xr kbdmux 4 ,
307abebc22fSWarren Block.Xr keyboard 4 ,
308abebc22fSWarren Block.Xr screen 4 ,
309abebc22fSWarren Block.Xr splash 4 ,
310abebc22fSWarren Block.Xr syscons 4 ,
311abebc22fSWarren Block.Xr ukbd 4 ,
312abebc22fSWarren Block.Xr kbdmap 5 ,
313abebc22fSWarren Block.Xr rc.conf 5 ,
314abebc22fSWarren Block.Xr ttys 5 ,
315abebc22fSWarren Block.Xr config 8 ,
316abebc22fSWarren Block.Xr getty 8 ,
317abebc22fSWarren Block.Xr kldload 8 ,
3185e819274SEd Maste.Xr moused 8 ,
3195e819274SEd Maste.Xr vtfontcvt 8
320a102d822SMarius Strobl.Sh HISTORY
321a102d822SMarius StroblThe
3223a8794beSJoel Dahl.Nm
323a102d822SMarius Strobldriver first appeared in
324a102d822SMarius Strobl.Fx 9.3 .
325abebc22fSWarren Block.Sh AUTHORS
326abebc22fSWarren Block.An -nosplit
327abebc22fSWarren BlockThe
328abebc22fSWarren Block.Nm
329abebc22fSWarren Blockdevice driver was developed by
330548afe2bSChristian Brueffer.An \&Ed Schouten Aq Mt ed@FreeBSD.org ,
331548afe2bSChristian Brueffer.An \&Ed Maste Aq Mt emaste@FreeBSD.org ,
332abebc22fSWarren Blockand
3336c899950SBaptiste Daroussin.An Aleksandr Rybalko Aq Mt ray@FreeBSD.org ,
334abebc22fSWarren Blockwith sponsorship provided by the
335abebc22fSWarren Block.Fx
336abebc22fSWarren BlockFoundation.
337abebc22fSWarren BlockThis manual page was written by
3386c899950SBaptiste Daroussin.An Warren Block Aq Mt wblock@FreeBSD.org .
339abebc22fSWarren Block.Sh CAVEATS
340abebc22fSWarren BlockPaste buffer size is limited by the system value
341abebc22fSWarren Block.Brq Dv MAX_INPUT ,
342abebc22fSWarren Blockthe number of bytes that can be stored in the terminal
343abebc22fSWarren Blockinput queue, usually 1024 bytes
344abebc22fSWarren Block(see
345abebc22fSWarren Block.Xr termios 4 ) .
346