---
name: "vt"
section: "4freebsd"
platform: "linux"
package: "freebsd-manpages"
version: "12.2-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/vt/4freebsd"
---

# vt(4freebsd)

virtual terminal console driver

## NAME

**vt** – virtual terminal console driver

## SYNOPSIS

**options TERMINAL\_KERN\_ATTR=\_attribute\_** **options TERMINAL\_NORM\_ATTR=\_attribute\_** **options VT\_MAXWINDOWS=N** **options VT\_ALT\_TO\_ESC\_HACK=1** **options VT\_TWOBUTTON\_MOUSE** **options VT\_FB\_MAX\_WIDTH=X** **options VT\_FB\_MAX\_HEIGHT=Y** **options SC\_NO\_CUTPASTE** **device vt**

In [loader.conf(5)](/loader.conf/5.md): **hw.vga.textmode=1** **hw.vga.acpi\_ignore\_no\_vga=1** **kern.vty=vt** **kern.vt.color.\<colornum\>.rgb="\<colorspec\>"** **kern.vt.fb.default\_mode="\<X\>x\<Y\>"** **kern.vt.fb.modes.\<connector\>="\<X\>x\<Y\>"**

In [loader.conf(5)](/loader.conf/5.md) or [sysctl.conf(5)](/sysctl.conf/5.md): **kern.vt.kbd\_halt=1** **kern.vt.kbd\_poweroff=1** **kern.vt.kbd\_reboot=1** **kern.vt.kbd\_debug=1** **kern.vt.kbd\_panic=0** **kern.vt.enable\_bell=1**

## DESCRIPTION

The **vt** device provides multiple virtual terminals with an extensive feature set:

-

  Unicode UTF-8 text with double-width characters.

-

  Large font maps in graphics mode, including support for Asian character sets.

-

  Graphics-mode consoles.

-

  Integration with KMS (Kernel Mode Setting) video drivers for switching between the *X* *Window* *System* and virtual terminals.

### Virtual Terminals

Multiple virtual terminals are provided on a single computer. Up to sixteen virtual terminals can be defined. A single virtual terminal is connected to the screen and keyboard at a time. Key combinations are used to select a virtual terminal. Alt-F1 through Alt-F12 correspond to the first twelve virtual terminals. If more than twelve virtual terminals are created, Shift-Alt-F1 through Shift-Alt-F4 are used to switch to the additional terminals.

### Copying and Pasting Text with a Mouse

Copying and pasting text from the screen with a mouse is supported. Press and hold down mouse button 1, usually the left button, while moving the mouse to select text. Selected text is highlighted with reversed foreground and background colors. To select more text after releasing mouse button 1, press mouse button 3, usually the right button. To paste text that has been selected, press mouse button 2, usually the middle button. The text is entered as if it were typed at the keyboard. The VT\_TWOBUTTON\_MOUSE kernel option can be used with mice that only have two buttons. Setting this option makes the second mouse button into the paste button. See [moused(8)](/moused/8.md) for more information.

### Scrolling Back

Output that has scrolled off the screen can be reviewed by pressing the Scroll Lock key, then scrolling up and down with the arrow keys. The Page Up and Page Down keys scroll up or down a full screen at a time. The Home and End keys jump to the beginning or end of the scrollback buffer. When finished reviewing, press the Scroll Lock key again to return to normal use.

## DRIVER CONFIGURATION

### Kernel Configuration Options

These kernel options control the **vt** driver.

- TERMINAL\_NORM\_ATTR=*attribute*

  - TERMINAL\_KERN\_ATTR=*attribute*

  These options change the default colors used for normal and kernel text. Available colors are defined in ⟨sys/terminal.h⟩. See EXAMPLES below.

- VT\_MAXWINDOWS=N

  Set the number of virtual terminals to be created to *N*. The value defaults to 12.

- VT\_ALT\_TO\_ESC\_HACK=1

  When the Alt key is held down while pressing another key, send an ESC sequence instead of the Alt key.

- VT\_TWOBUTTON\_MOUSE

  If defined, swap the functions of mouse buttons 2 and 3. In effect, this makes the right-hand mouse button perform a paste. These options are checked in the order shown.

- SC\_NO\_CUTPASTE

  Disable mouse support.

- VT\_FB\_MAX\_WIDTH=X

  Set the maximum width to *X*.

- VT\_FB\_MAX\_HEIGHT=Y

  Set the maximum height to *Y*.

## BACKWARDS COMPATIBILITY

Several options are provided for compatibility with the previous console device, [sc(4)](/sc/4.md). These options will be removed in a future FreeBSD version.

| | |
| --- | --- |
| **vt** **Option** **Name** | **sc** **Option** **Name** |
| TERMINAL\_KERN\_ATTR | SC\_KERNEL\_CONS\_ATTR |
| TERMINAL\_NORM\_ATTR | SC\_NORM\_ATTR |
| VT\_TWOBUTTON\_MOUSE | SC\_TWOBUTTON\_MOUSE |
| VT\_MAXWINDOWS | MAXCONS |
| none | SC\_NO\_CUTPASTE |

## START-UP OPERATION WITH X86 BIOS SYSTEMS

The computer BIOS starts in text mode, and the FreeBSD [loader(8)](/loader/8.md) runs, loading the kernel. If *hw.vga.textmode* is set, the system remains in text mode. Otherwise, **vt** switches to 640x480x16 VGA mode using **vt\_vga**. If a KMS (Kernel Mode Setting) video driver is available, the display is switched to high resolution and the KMS driver takes over. When a KMS driver is not available, **vt\_vga** remains active.

## LOADER TUNABLES

These settings can be entered at the [loader(8)](/loader/8.md) prompt or in [loader.conf(5)](/loader.conf/5.md).

- *hw.vga.textmode*

  Set to 1 to use virtual terminals in text mode instead of graphics mode. Features that require graphics mode, like loadable fonts, will be disabled.

- *hw.vga.acpi\_ignore\_no\_vga*

  Set to 1 to force the usage of the VGA driver regardless of whether ACPI IAPC\_BOOT\_ARCH signals no VGA support. Can be used to workaround firmware bugs in the ACPI tables.

- *kern.vty*

  Set this value to ‘vt’ or ‘sc’ to choose a specific system console, overriding the default. The *GENERIC* kernel uses **vt** when this value is not set.

- *kern.vt.color.**colornum**.rgb*

  Set this value to override default palette entry for color *colornum* which should be in a range from 0 to 15 inclusive. The value should be either a comma-separated triplet of red, green, and blue values in a range from 0 to 255 or HTML-like hex triplet. See EXAMPLES below.

- *kern.vt.fb.default\_mode*

  Set this value to a graphic mode to override the default mode picked by the **vt** backend. The mode is applied to all output connectors. This is currently only supported by the **vt\_fb** backend when it is paired with a KMS video driver.

- *kern.vt.fb.modes.**connector\_name*

  Set this value to a graphic mode to override the default mode picked by the **vt** backend. This mode is applied to the output connector *connector\_name* only. It has precedence over *kern.vt.fb.default\_mode*. The names of available connector names can be found in [dmesg(8)](/dmesg/8.md) after loading the KMS driver. It will contain a list of connectors and their associated tunables. This is currently only supported by the **vt\_fb** backend when it is paired with a KMS video driver.

## KEYBOARD SYSCTL TUNABLES

These settings control whether certain special key combinations are enabled or ignored. The specific key combinations can be configured by using a [keymap(5)](/keymap/5.md) file.

These settings can be entered at the [loader(8)](/loader/8.md) prompt or in [loader.conf(5)](/loader.conf/5.md) and can also be changed at runtime with the [sysctl(8)](/sysctl/8.md) command.

- *kern.vt.kbd\_halt*

  Enable halt keyboard combination.

- *kern.vt.kbd\_poweroff*

  Enable power off key combination.

- *kern.vt.kbd\_reboot*

  Enable reboot key combination, usually Ctrl+Alt+Del.

- *kern.vt.kbd\_debug*

  Enable debug request key combination, usually Ctrl+Alt+Esc.

- *kern.vt.kbd\_panic*

  Enable panic key combination.

## OTHER SYSCTL TUNABLES

These settings can be entered at the [loader(8)](/loader/8.md) prompt, set in [loader.conf(5)](/loader.conf/5.md), or changed at runtime with [sysctl(8)](/sysctl/8.md).

- *kern.vt.enable\_bell*

  Enable the terminal bell.

## FILES

- */dev/console*

  - */dev/consolectl*

  - */dev/ttyv\**

  virtual terminals

- */etc/ttys*

  terminal initialization information

- */usr/share/vt/fonts/\*.fnt*

  console fonts

- */usr/share/vt/keymaps/\*.kbd*

  keyboard layouts

## EXAMPLES

This example changes the default color of normal text to green on a black background, or black on a green background when reversed. Note that white space cannot be used inside the attribute string because of the current implementation of [config(8)](/config/8.md).

```
options TERMINAL_NORM_ATTR=(FG_GREEN|BG_BLACK)
```

This line changes the default color of kernel messages to be bright red on a black background, or black on a bright red background when reversed.

```
options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK)
```

To set a 1024x768 mode on all output connectors, put the following line in */boot/loader.conf*:

```
kern.vt.fb.default_mode="1024x768"
```

To set a 800x600 only on a laptop builtin screen, use the following line instead:

```
kern.vt.fb.modes.LVDS-1="800x600"
```

The connector name was found in [dmesg(8)](/dmesg/8.md):

```
info: [drm] Connector LVDS-1: get mode from tunables:
```

```
info: [drm] - kern.vt.fb.modes.LVDS-1
```

```
info: [drm] - kern.vt.fb.default_mode
```

To set black and white colors of console palette

```
kern.vt.color.0.rgb="10,10,10"
```

```
kern.vt.color.15.rgb="#f0f0f0"
```

## SEE ALSO

[kbdcontrol(1)](/kbdcontrol/1.md), [login(1)](/login/1.md), [vidcontrol(1)](/vidcontrol/1.md), [atkbd(4)](/atkbd/4.md), [atkbdc(4)](/atkbdc/4.md), [kbdmux(4)](/kbdmux/4.md), [keyboard(4)](/keyboard/4.md), [screen(4)](/screen/4.md), [splash(4)](/splash/4.md), [syscons(4)](/syscons/4.md), [ukbd(4)](/ukbd/4.md), [kbdmap(5)](/kbdmap/5.md), [rc.conf(5)](/rc.conf/5.md), [ttys(5)](/ttys/5.md), [config(8)](/config/8.md), [getty(8)](/getty/8.md), [kldload(8)](/kldload/8.md), [moused(8)](/moused/8.md), [vtfontcvt(8)](/vtfontcvt/8.md)

## HISTORY

The **vt** driver first appeared in FreeBSD 9.3.

## AUTHORS

The **vt** device driver was developed by Ed Schouten ⟨*ed@FreeBSD.org*⟩, Ed Maste ⟨*emaste@FreeBSD.org*⟩, and Aleksandr Rybalko ⟨*ray@FreeBSD.org*⟩, with sponsorship provided by the FreeBSD Foundation. This manual page was written by Warren Block ⟨*wblock@FreeBSD.org*⟩.

## CAVEATS

Paste buffer size is limited by the system value {MAX\_INPUT}, the number of bytes that can be stored in the terminal input queue, usually 1024 bytes (see [termios(4)](/termios/4.md)).
