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.\" 27*f41bde66SConrad Meyer.Dd July 19, 2016 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" 39*f41bde66SConrad Meyer.Cd "options VT_FB_MAX_WIDTH=X" 40*f41bde66SConrad Meyer.Cd "options VT_FB_MAX_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 595b3078c3SWarren Block.Cd kern.vt.enable_bell=1 60abebc22fSWarren Block.Sh DESCRIPTION 61abebc22fSWarren BlockThe 62abebc22fSWarren Block.Nm 63abebc22fSWarren Blockdevice provides multiple virtual terminals with an extensive feature 64abebc22fSWarren Blockset: 65abebc22fSWarren Block.Bl -item -offset indent 66abebc22fSWarren Block.It 67abebc22fSWarren BlockUnicode UTF-8 text with double-width characters. 68abebc22fSWarren Block.It 69abebc22fSWarren BlockLarge font maps in graphics mode, including support for Asian 70abebc22fSWarren Blockcharacter sets. 71abebc22fSWarren Block.It 72abebc22fSWarren BlockGraphics-mode consoles. 73abebc22fSWarren Block.It 74abebc22fSWarren BlockIntegration with 75abebc22fSWarren BlockKMS 76abebc22fSWarren Block.Pq Kernel Mode Setting 77abebc22fSWarren Blockvideo drivers for switching between the 78abebc22fSWarren Block.Em X Window System 79abebc22fSWarren Blockand virtual terminals. 80abebc22fSWarren Block.El 81abebc22fSWarren Block.Ss Virtual Terminals 82abebc22fSWarren BlockMultiple virtual terminals are provided on a single computer. 83abebc22fSWarren BlockUp to sixteen virtual terminals can be defined. 84abebc22fSWarren BlockA single virtual terminal is connected to the screen and keyboard 85abebc22fSWarren Blockat a time. 86abebc22fSWarren BlockKey combinations are used to select a virtual terminal. 87abebc22fSWarren BlockAlt-F1 through Alt-F12 correspond to the first twelve virtual terminals. 88abebc22fSWarren BlockIf more than twelve virtual terminals are created, Shift-Alt-F1 through 89abebc22fSWarren BlockShift-Alt-F4 are used to switch to the additional terminals. 90abebc22fSWarren Block.Ss Copying and Pasting Text with a Mouse 91abebc22fSWarren BlockCopying and pasting text from the screen with a mouse is supported. 92abebc22fSWarren BlockPress and hold down mouse button 1, usually the left button, while 93abebc22fSWarren Blockmoving the mouse to select text. 94abebc22fSWarren BlockSelected text is highlighted with reversed foreground and background 95abebc22fSWarren Blockcolors. 96abebc22fSWarren BlockTo select more text after releasing mouse button 1, press mouse button 97abebc22fSWarren Block3, usually the right button. 98abebc22fSWarren BlockTo paste text that has been selected, press mouse button 2, usually the 99abebc22fSWarren Blockmiddle button. 100abebc22fSWarren BlockThe text is entered as if it were typed at the keyboard. 101abebc22fSWarren BlockThe 102abebc22fSWarren Block.Dv VT_TWOBUTTON_MOUSE 103abebc22fSWarren Blockkernel option can be used with mice that only have two buttons. 104abebc22fSWarren BlockSetting this option makes the second mouse button into the 105abebc22fSWarren Blockpaste button. 106abebc22fSWarren BlockSee 107abebc22fSWarren Block.Xr moused 8 108abebc22fSWarren Blockfor more information. 109abebc22fSWarren Block.Ss Scrolling Back 110abebc22fSWarren BlockOutput that has scrolled off the screen can be reviewed by pressing the 111abebc22fSWarren BlockScroll Lock key, then scrolling up and down with the arrow keys. 112abebc22fSWarren BlockThe Page Up and Page Down keys scroll up or down a full screen at a 113abebc22fSWarren Blocktime. 114abebc22fSWarren BlockThe Home and End keys jump to the beginning or end of the scrollback 115abebc22fSWarren Blockbuffer. 116abebc22fSWarren BlockWhen finished reviewing, press the Scroll Lock key again to return to 117abebc22fSWarren Blocknormal use. 118abebc22fSWarren Block.Sh DRIVER CONFIGURATION 119abebc22fSWarren Block.Ss Kernel Configuration Options 120abebc22fSWarren BlockThese kernel options control the 121abebc22fSWarren Block.Nm 122abebc22fSWarren Blockdriver. 123abebc22fSWarren Block.Bl -tag -width MAXCONS 1248329214dSWarren Block.It Dv TERMINAL_NORM_ATTR= Ns Pa attribute 1258329214dSWarren Block.It Dv TERMINAL_KERN_ATTR= Ns Pa attribute 1265b3078c3SWarren BlockThese options change the default colors used for normal and kernel 1278329214dSWarren Blocktext. 1287344ee18SMarius StroblAvailable colors are defined in 1297344ee18SMarius Strobl.In sys/terminal.h . 1307344ee18SMarius StroblSee 1317344ee18SMarius Strobl.Sx EXAMPLES 1327344ee18SMarius Stroblbelow. 133abebc22fSWarren Block.It Dv VT_MAXWINDOWS=N 134abebc22fSWarren BlockSet the number of virtual terminals to be created to 135abebc22fSWarren Block.Fa N . 136abebc22fSWarren BlockThe value defaults to 12. 137abebc22fSWarren Block.It Dv VT_ALT_TO_ESC_HACK=1 138abebc22fSWarren BlockWhen the Alt key is held down while pressing another key, send an ESC 139abebc22fSWarren Blocksequence instead of the Alt key. 140abebc22fSWarren Block.It Dv VT_TWOBUTTON_MOUSE 141abebc22fSWarren BlockIf defined, swap the functions of mouse buttons 2 and 3. 142abebc22fSWarren BlockIn effect, this makes the right-hand mouse button perform a paste. 143abebc22fSWarren BlockThese options are checked in the order shown. 144abebc22fSWarren Block.It Dv SC_NO_CUTPASTE 145abebc22fSWarren BlockDisable mouse support. 146abebc22fSWarren Block.It VT_FB_DEFAULT_WIDTH=X 147abebc22fSWarren BlockSet the default width to 148abebc22fSWarren Block.Fa X . 149abebc22fSWarren Block.It VT_FB_DEFAULT_HEIGHT=Y 150abebc22fSWarren BlockSet the default height to 151abebc22fSWarren Block.Fa Y . 152abebc22fSWarren Block.El 153abebc22fSWarren Block.Sh BACKWARDS COMPATIBILITY 154abebc22fSWarren BlockSeveral options are provided for compatibility with the previous 155abebc22fSWarren Blockconsole device, 156abebc22fSWarren Block.Xr sc 4 . 157abebc22fSWarren BlockThese options will be removed in a future 158abebc22fSWarren Block.Fx 159abebc22fSWarren Blockversion. 160abebc22fSWarren Block.Bl -column -offset indent ".Sy vt VT_TWOBUTTON_MOUSE" ".Sy SC_TWOBUTTON_MOUSE" 161abebc22fSWarren Block.It Sy vt Option Name Ta Sy sc Option Name 1627344ee18SMarius Strobl.It Dv TERMINAL_KERN_ATTR Ta Dv SC_KERNEL_CONS_ATTR 1637344ee18SMarius Strobl.It Dv TERMINAL_NORM_ATTR Ta Dv SC_NORM_ATTR 164abebc22fSWarren Block.It Dv VT_TWOBUTTON_MOUSE Ta Dv SC_TWOBUTTON_MOUSE 165abebc22fSWarren Block.It Dv VT_MAXWINDOWS Ta Dv MAXCONS 166abebc22fSWarren Block.It none Ta Dv SC_NO_CUTPASTE 167abebc22fSWarren Block.El 168abebc22fSWarren Block.Sh START-UP OPERATION WITH X86 BIOS SYSTEMS 169abebc22fSWarren BlockThe computer BIOS starts in text mode, and 170abebc22fSWarren Blockthe 171abebc22fSWarren Block.Fx 172abebc22fSWarren Block.Xr loader 8 173abebc22fSWarren Blockruns, loading the kernel. 174abebc22fSWarren BlockIf 175abebc22fSWarren Block.Va hw.vga.textmode 176abebc22fSWarren Blockis set, the system remains in text mode. 177abebc22fSWarren BlockOtherwise, 178abebc22fSWarren Block.Nm 179abebc22fSWarren Blockswitches to 640x480x16 VGA mode using 1808329214dSWarren Block.Cm vt_vga . 181abebc22fSWarren BlockIf a KMS 18279c4bda8SJean-Sébastien Pédron.Pq Kernel Mode Setting 183abebc22fSWarren Blockvideo driver is available, the display is switched to high resolution 184abebc22fSWarren Blockand the KMS driver takes over. 185abebc22fSWarren BlockWhen a KMS driver is not available, 1868329214dSWarren Block.Cm vt_vga 187abebc22fSWarren Blockremains active. 188abebc22fSWarren Block.Sh LOADER TUNABLES 189abebc22fSWarren BlockThese settings can be entered at the 190abebc22fSWarren Block.Xr loader 8 191abebc22fSWarren Blockprompt or in 192abebc22fSWarren Block.Xr loader.conf 5 . 193abebc22fSWarren Block.Bl -tag -width indent 194abebc22fSWarren Block.It Va hw.vga.textmode 195abebc22fSWarren BlockSet to 1 to use virtual terminals in text mode instead of graphics mode. 196abebc22fSWarren BlockFeatures that require graphics mode, like loadable fonts, will be 197abebc22fSWarren Blockdisabled. 19859644098SEd Maste.It Va kern.vty 199d98ae075SEd MasteSet this value to 2008329214dSWarren Block.Ql vt 2018329214dSWarren Blockor 202d98ae075SEd Maste.Ql sc 20384e3706cSEd Masteto choose a specific system console, overriding the default. 20484e3706cSEd MasteIf not set, the default in the 20584e3706cSEd Maste.Pa GENERIC 20684e3706cSEd Mastekernel is 20784e3706cSEd Maste.Nm . 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 2155b3078c3SWarren Blockbackend when it is 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 2225b3078c3SWarren Blockonly. 2235b3078c3SWarren BlockIt has precedence over 22479c4bda8SJean-Sébastien Pédron.Va kern.vt.fb.default_mode . 225a95c4612SJean-Sébastien PédronThe names of available connector names can be found in 226a95c4612SJean-Sébastien Pédron.Xr dmesg 8 2274261dbcfSJean-Sébastien Pédronafter loading the KMS driver. 2284261dbcfSJean-Sébastien PédronIt will contain a list of connectors and their associated tunables. 2294261dbcfSJean-Sébastien PédronThis is currently only supported by the 23079c4bda8SJean-Sébastien Pédron.Cm vt_fb 2315b3078c3SWarren Blockbackend when it is paired with a KMS video driver. 23279c4bda8SJean-Sébastien Pédron.El 233d98ae075SEd Maste.Sh KEYBOARD SYSCTL TUNABLES 234d98ae075SEd MasteThese settings control whether certain special key combinations are enabled or 235d98ae075SEd Masteignored. 236d98ae075SEd MasteThe specific key combinations can be configured by using a 237d98ae075SEd Maste.Xr keymap 5 238d98ae075SEd Mastefile. 239d98ae075SEd Maste.Pp 240d98ae075SEd MasteThese settings can be entered at the 241d98ae075SEd Maste.Xr loader 8 242d98ae075SEd Masteprompt or in 243d98ae075SEd Maste.Xr loader.conf 5 244d98ae075SEd Masteand can also be changed at runtime with the 245d98ae075SEd Maste.Xr sysctl 8 246d98ae075SEd Mastecommand. 247d98ae075SEd Maste.Bl -tag -width indent 248d98ae075SEd Maste.It Va kern.vt.kbd_halt 249d98ae075SEd MasteEnable halt keyboard combination. 250d98ae075SEd Maste.It Va kern.vt.kbd_poweroff 251d98ae075SEd MasteEnable power off key combination. 252d98ae075SEd Maste.It Va kern.vt.kbd_reboot. 253d98ae075SEd MasteEnable reboot key combination, usually Ctrl+Alt+Del. 254d98ae075SEd Maste.It Va kern.vt.kbd_debug 255d98ae075SEd MasteEnable debug request key combination, usually Ctrl+Alt+Esc. 256d98ae075SEd Maste.It Va kern.vt.kbd_panic 257d98ae075SEd MasteEnable panic key combination. 258abebc22fSWarren Block.El 2595b3078c3SWarren Block.Sh OTHER SYSCTL TUNABLES 2605b3078c3SWarren BlockThese settings can be entered at the 2615b3078c3SWarren Block.Xr loader 8 2625b3078c3SWarren Blockprompt, set in 2635b3078c3SWarren Block.Xr loader.conf 5 , 2645b3078c3SWarren Blockor changed at runtime with 2655b3078c3SWarren Block.Xr sysctl 8 . 2665b3078c3SWarren Block.Bl -tag -width indent 2675b3078c3SWarren Block.It Va kern.vt.enable_bell 2685b3078c3SWarren BlockEnable the terminal bell. 2695b3078c3SWarren Block.El 270abebc22fSWarren Block.Sh FILES 271651045d6SStefan Eßer.Bl -tag -width /usr/share/vt/keymaps/* -compact 272abebc22fSWarren Block.It Pa /dev/console 273abebc22fSWarren Block.It Pa /dev/consolectl 274abebc22fSWarren Block.It Pa /dev/ttyv* 275abebc22fSWarren Blockvirtual terminals 276abebc22fSWarren Block.It Pa /etc/ttys 277abebc22fSWarren Blockterminal initialization information 278651045d6SStefan Eßer.It Pa /usr/share/vt/fonts/*.fnt 279651045d6SStefan Eßerconsole fonts 280651045d6SStefan Eßer.It Pa /usr/share/vt/keymaps/*.kbd 281651045d6SStefan Eßerkeyboard layouts 282abebc22fSWarren Block.El 2838329214dSWarren Block.Sh EXAMPLES 2848329214dSWarren BlockThis example changes the default color of normal text to green on a 2858329214dSWarren Blockblack background, or black on a green background when reversed. 2868329214dSWarren BlockNote that white space cannot be used inside the attribute string 2878329214dSWarren Blockbecause of the current implementation of 2888329214dSWarren Block.Xr config 8 . 2898329214dSWarren Block.Pp 2908329214dSWarren Block.Dl "options TERMINAL_NORM_ATTR=(FG_GREEN|BG_BLACK)" 2918329214dSWarren Block.Pp 2928329214dSWarren BlockThis line changes the default color of kernel messages to be bright red 2938329214dSWarren Blockon a black background, or black on a bright red background when reversed. 2948329214dSWarren Block.Pp 2958329214dSWarren Block.Dl "options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK)" 29679c4bda8SJean-Sébastien Pédron.Pp 29779c4bda8SJean-Sébastien PédronTo set a 1024x768 mode on all output connectors, put the following line in 29879c4bda8SJean-Sébastien Pédron.Pa /boot/loader.conf : 29979c4bda8SJean-Sébastien Pédron.Pp 30079c4bda8SJean-Sébastien Pédron.Dl kern.vt.fb.default_mode="1024x768" 30179c4bda8SJean-Sébastien Pédron.Pp 30279c4bda8SJean-Sébastien PédronTo set a 800x600 only on a laptop builtin screen, use the following line instead: 30379c4bda8SJean-Sébastien Pédron.Pp 30479c4bda8SJean-Sébastien Pédron.Dl kern.vt.fb.modes.LVDS-1="800x600" 30579c4bda8SJean-Sébastien Pédron.Pp 30679c4bda8SJean-Sébastien PédronThe connector name was found in 30779c4bda8SJean-Sébastien Pédron.Xr dmesg 8 : 30879c4bda8SJean-Sébastien Pédron.Pp 30979c4bda8SJean-Sébastien Pédron.Dl info: [drm] Connector LVDS-1: get mode from tunables: 31079c4bda8SJean-Sébastien Pédron.Dl info: [drm] - kern.vt.fb.modes.LVDS-1 31179c4bda8SJean-Sébastien Pédron.Dl info: [drm] - kern.vt.fb.default_mode 312abebc22fSWarren Block.Sh SEE ALSO 313abebc22fSWarren Block.Xr kbdcontrol 1 , 314abebc22fSWarren Block.Xr login 1 , 315abebc22fSWarren Block.Xr vidcontrol 1 , 316abebc22fSWarren Block.Xr atkbd 4 , 317abebc22fSWarren Block.Xr atkbdc 4 , 318345c0478SEdward Tomasz Napierala.Xr kbdmux 4 , 319abebc22fSWarren Block.Xr keyboard 4 , 320abebc22fSWarren Block.Xr screen 4 , 321abebc22fSWarren Block.Xr splash 4 , 322abebc22fSWarren Block.Xr syscons 4 , 323abebc22fSWarren Block.Xr ukbd 4 , 324abebc22fSWarren Block.Xr kbdmap 5 , 325abebc22fSWarren Block.Xr rc.conf 5 , 326abebc22fSWarren Block.Xr ttys 5 , 327abebc22fSWarren Block.Xr config 8 , 328abebc22fSWarren Block.Xr getty 8 , 329abebc22fSWarren Block.Xr kldload 8 , 3305e819274SEd Maste.Xr moused 8 , 3315e819274SEd Maste.Xr vtfontcvt 8 332a102d822SMarius Strobl.Sh HISTORY 333a102d822SMarius StroblThe 3343a8794beSJoel Dahl.Nm 335a102d822SMarius Strobldriver first appeared in 336a102d822SMarius Strobl.Fx 9.3 . 337abebc22fSWarren Block.Sh AUTHORS 338abebc22fSWarren Block.An -nosplit 339abebc22fSWarren BlockThe 340abebc22fSWarren Block.Nm 341abebc22fSWarren Blockdevice driver was developed by 342548afe2bSChristian Brueffer.An \&Ed Schouten Aq Mt ed@FreeBSD.org , 343548afe2bSChristian Brueffer.An \&Ed Maste Aq Mt emaste@FreeBSD.org , 344abebc22fSWarren Blockand 3456c899950SBaptiste Daroussin.An Aleksandr Rybalko Aq Mt ray@FreeBSD.org , 346abebc22fSWarren Blockwith sponsorship provided by the 347abebc22fSWarren Block.Fx 348abebc22fSWarren BlockFoundation. 349abebc22fSWarren BlockThis manual page was written by 3506c899950SBaptiste Daroussin.An Warren Block Aq Mt wblock@FreeBSD.org . 351abebc22fSWarren Block.Sh CAVEATS 352abebc22fSWarren BlockPaste buffer size is limited by the system value 353abebc22fSWarren Block.Brq Dv MAX_INPUT , 354abebc22fSWarren Blockthe number of bytes that can be stored in the terminal 355abebc22fSWarren Blockinput queue, usually 1024 bytes 356abebc22fSWarren Block(see 357abebc22fSWarren Block.Xr termios 4 ) . 358