Path: blob/main/documentation/content/en/books/accessibility/virtual-terminal/_index.adoc
18099 views
---
title: Chapter 2. Virtual Terminal
part: Part II. Vision
prev: books/accessibility/partii
next: books/accessibility/colors
description: Available features in the virtual console useful for accessibility
tags: ["Accessibility", "Terminal"]
showBookMenu: true
weight: 5
params:
path: "/books/accessibility/virtual-terminal/"
---
[[virtual-terminal]]
= Virtual Terminal
:doctype: book
:toc: macro
:toclevels: 1
:icons: font
:sectnums:
:sectnumlevels: 6
:sectnumoffset: 2
:partnums:
:source-highlighter: rouge
:experimental:
:images-path: books/accessibility/virtual-terminal/
ifdef::env-beastie[]
ifdef::backend-html5[]
:imagesdir: ../../../../images/{images-path}
endif::[]
ifndef::book[]
include::shared/authors.adoc[]
include::shared/mirrors.adoc[]
include::shared/releases.adoc[]
include::shared/attributes/attributes-{{% lang %}}.adoc[]
include::shared/{{% lang %}}/teams.adoc[]
include::shared/{{% lang %}}/mailing-lists.adoc[]
include::shared/{{% lang %}}/urls.adoc[]
toc::[]
endif::[]
ifdef::backend-pdf,backend-epub3[]
include::../../../../../shared/asciidoctor.adoc[]
endif::[]
endif::[]
ifndef::env-beastie[]
toc::[]
include::../../../../../shared/asciidoctor.adoc[]
endif::[]
[[vt4-intro]]
== Introduction
Virtual Terminal, commonly referenced and documented as man:vt[4] is the system's built-in extref:{handbook}ports[virtual console].
It is installed by default, provides a command-line interface, and starts automatically at boot.
This chapter presents an overview and examples of key features and utilities relevant to visual accessibility.
[[vt4-colors]]
== Colors
The Virtual Terminal supports color configuration both via configuration files and interactively through a dedicated utility.
[[vt4-colors-loader]]
=== Loader.conf
Colors can be set and saved using the man:loader.conf[5] file.
To change a default color, add a line in the following format:
`kern.vt.color._colornum_.rgb="_colorspec_"`, where:
- `_colornum_` is the numeric identifier of the color to be customized (see the table below).
- `_colorspec_` is a specification of the color, either as a comma-separated RGB triplet (red, green, and blue, each value from 0 to 255) or as an HTML-style hexadecimal value.
.Default palette: Color, color number, default color in rgb, default color in html.
[options="header", cols="1,1,1,1"]
|===
| Color | _colornum_ | default _colorspec_ RGB | default _colorspec_ html
| Black
| 0
| 0,0,0
| #000000
| Dark red
| 1
| 127,0,0
| #7f0000
| Dark green
| 2
| 0,127,0
| #007f00
| Dark yellow
| 3
| 196,161,0
| #c4a100
| Dark blue
| 4
| 51,102,163
| #3366a3
| Dark magenta
| 5
| 127,0,127
| #7f007f
| Dark cyan
| 6
| 0,127,127
| #007f7f
| Light gray
| 7
| 191,191,191
| #bfbfbf
| Dark gray
| 8
| 115,130,138
| #73828a
| Light red
| 9
| 255,0,0
| #ff0000
| Light green
| 10
| 0,255, 0
| #00ff00
| Light yellow
| 11
| 255,255,0
| #ffff00
| Light blue
| 12
| 115,158,207
| #739ecf
| Light magenta
| 13
| 255,0,255
| #ff00ff
| Light cyan
| 14
| 0,255,255
| #00ffff
| White
| 15
| 255,255,255
| #ffffff
|===
[[vt4-example-loader-conf-colors]]
.Set background in white, text in black, boot messages in red.
[example]
====
[.filename]#/boot/loader.conf#
[.programlisting]
....
# Background black to white
kern.vt.color.0.rgb="255,255,255"
# Text light gray to black
kern.vt.color.7.rgb="0,0,0"
# Boot white to red
kern.vt.color.15.rgb="255,0,0"
....
====
[[vidcontrol]]
=== Vidcontrol
The man:vidcontrol[1] utility allows you to configure colors interactively.
Use the `show` option to display the list of available colors:
[source,shell]
....
% vidcontrol show
....
To set the foreground color, use `vidcontrol _color_`.
For example, to set the text color to green:
[source,shell]
....
% vidcontrol green
....
To set both foreground and background colors, use `vidcontrol _foreground_ _background_`.
For example, to set blue text on a green background:
[source,shell]
....
% vidcontrol blue green
....
Configurations made with man:vidcontrol[1] are not persistent across shutdown.
To make the settings permanent, add the following line to man:rc.conf[5]:
`allscreens_flags="-c _foreground_ _background_"`.
[[vt4-vidcontrol-colors-rc]]
.Set blue foreground and green background.
[example]
====
[.filename]#/etc/rc.conf#
[.programlisting]
....
allscreens_flags="-c blue green"
....
====
[NOTE]
====
Setting allscreens_flags="-c _colors_" in [.filename]#/etc/rc.conf# takes effect after the system boots.
To change the colors during the boot process, edit [.filename]#/boot/loader.conf# as crossref:virtual-terminal[vt4-colors-loader,previously described].
====
[[vt4-resolution]]
== Resolution
The `kern.vt.fb.default_mode="<width>x<height>"` option in man:loader.conf[5] allows you to configure the display resolution.
Technically, it specifies the display mode of the Virtual Terminal, allowing you to control the size of elements displayed on the screen.
[[vt4-example-resolution]]
.Sets the width to 800 and the height to 600.
[example]
====
[.filename]#/boot/loader.conf#
[.programlisting]
....
kern.vt.fb.default_mode="800x600"
....
====
[[vt4-font]]
== Font
Virtual Terminal allows you to configure the font in use, and the system supports installing and utilizing additional fonts.
[[vt4-select-font]]
=== Select a Font
The utilities man:vidfont[1] and man:vidcontrol[1] can load a font from [.filename]#/usr/share/vt/fonts/#.
To list the currently available fonts:
[source,shell]
....
% ls /usr/share/vt/fonts
....
Usually a file name has the format `<name>-<width>x<height>`, where:
- `<name>` is the font name.
- `<width>x<height>` is the size.
man:vidfont[1] provides an interactive menu in a Text User Interface to select a font.
Run the following command:
[source,shell]
....
% vidfont
....
Alternatively, man:vidcontrol[1] provides a CLI, `vidcontrol -f _font_`.
Example for `spleen-32x64.fnt`:
[source,shell]
....
% vidcontrol -f spleen-32x64.fnt
....
[TIP]
====
Tip: You can omit the _.fnt_ extension when specifying the file name.
For example, to load `spleen-32x64.fnt`, use:
[source,shell]
....
% vidcontrol -f spleen-32x64
....
====
Settings configured with either utility are not preserved after a reboot.
[[vt4-vidcontrol-font-rc]]
.Select the font to load at each startup.
[example]
====
[.filename]#/etc/rc.conf#
[.programlisting]
....
allscreens_flags="-f spleen-32x64.fnt"
....
====
[[vt4-new-font]]
=== New Fonts
The man:vtfontcvt[8] utility allows you to convert a font into the .fnt format for use in the Virtual Terminal.
The converted font must be copied to [.filename]#/usr/share/vt/fonts/# and selected as crossref:virtual-terminal[vt4-select-font,previously described].
[[vt4-bell]]
== Bell
The terminal bell can be activated by:
[source,shell]
....
# sysctl kern.vt.enable_bell=1
....
To make the configuration persistent after reboot, save it in either man:loader.conf[5] or man:sysctl.conf[5].
[[vt4-example-bell]]
.Active the bell at each startup.
[example]
====
[.filename]#/boot/loader.conf#
or
[.filename]#/etc/sysctl.conf#
[.programlisting]
....
kern.vt.enable_bell=1
....
====