SCREEN(4)
β¨ SCREEN(4) β¨
okay bestie, sit down, hydrate π this is the manual page for screen β the pc display interface β straight out of the Kernel Interfaces Manual. Yes it's section 4. Yes it's about your virtual consoles. No it is not the screen(1) multiplexer, don't @ me π
πΈ NAME πΈ
screen β pc display interface π₯οΈβ¨
π¦ DESCRIPTION π¦
So how do you even get to the virtual consoles? Through the device files, babe: /dev/ttyv0 all the way to /dev/ttyvb. Each one of those files is its own separate virtual console, its own lil universe π
You can have all the virtual console devices open at once, but only one is active at a time β only one gets main character energy π The active virtual console "owns" the keyboard and the display screen. Periodt.
Now if you write output to a virtual console that isn't currently on the display, it is not lost, don't panic π it gets saved in a buffer that holds a "screenfull" (normally 25) lines. And anything written to /dev/console (the original console device) is echoed to /dev/ttyv0. Cute, right?
π switching between consoles
To switch between the virtual consoles you use the sequence ALT+Fn β which means hold down ALT and press one of the function keys. The virtual console with the same number as that function key then gets selected as the current virtual console, and it gets exclusive use of the keyboard and display. Slay π
This switch sequence can be changed via the keyboard mapping ioctl call β go read keyboard(4) if you wanna go deeper, iykyk.
π’ entering values that aren't physically on the keyboard
The console lets you enter values that aren't physically present on the keyboard through a special keysequence π« To use this: press and hold down ALT, then enter a decimal number from 0-255 via the numerical keypad, then release ALT. The entered value is then used as the ASCII value for one character. So yes bestie, you can enter any ASCII value this way. Iconic.
π the history function
The console driver also includes a history function, and it's activated by pressing the scroll-lock key. That holds the display and enables the cursor arrows for scrolling up and down through the last scrolled out lines. Time travel but make it terminal π°οΈβ¨
π¨ character sequences
The console understands a subset of the ANSI x3.64 character sequences. And for compatibility with the old pccons, the PC3 character sequences are also supported. We love a backwards-compatible king π«Ά
π every sequence, no skips, we don't do that here
Format is: ANSI name Β· sequence β what it does β termcap entry. A -- means there isn't one, and that's valid too π
--Β·E7β Save cursor position β termcap:sc--Β·E8β Restore saved cursor position β termcap:rc--Β·Ecβ Reset β termcap:rs--Β·EMβ move cursor up 1 line, scroll if at top β termcap:--CUUΒ·E[nAβ move cursor up n lines β termcap:up/UP(ku)CUDΒ·E[nBβ move cursor down n lines β termcap:do/DO(kd)CUFΒ·E[nCβ move cursor right n characters β termcap:nd/RI(kr)CUBΒ·E[nDβ move cursor left n characters β termcap:--/LE(kl)HPAΒ·E[n`β move cursor to character position n β termcap:chHPRΒ·E[naβ move cursor right n characters β termcap:--VPAΒ·E[ndβ move cursor to line n β termcap:cvVPRΒ·E[neβ move cursor down n lines β termcap:--CPLΒ·E[nFβ move cursor to start of line, n lines up β termcap:-- (@7)CNLΒ·E[nEβ move cursor to start of line, n lines down β termcap:nwCUPΒ·E[y;xHβ Move cursor to x, y β termcap:cmHVPΒ·E[y;xfβ Move cursor to x, y β termcap:--CBTΒ·E[nZβ Move cursor back n tab stops β termcap:bt(kB)ILΒ·E[nLβ Insert n blank lines β termcap:al/ALICHΒ·E[n@β Insert n blank characters β termcap:ic/ICDLΒ·E[nMβ Delete n lines β termcap:dl/DLDCHΒ·E[nPβ Delete n characters β termcap:dc/DCEDΒ·E[nJβ Erase part or all of display β termcap:cdn=0from cursor to end of displayn=1from begin of display to cursorn=2entire display
ELΒ·E[nKβ Erase part or all of line β termcap:cen=0from cursor to end of linen=1from begin of line to cursorn=2entire line
ECHΒ·E[nXβ Erase n characters β termcap:ecSUΒ·E[nSβ Scroll display n lines up (forward) β termcap:sf/SFSDΒ·E[nTβ Scroll display n lines down (reverse) β termcap:sr/SRSGRΒ·E[nmβ Set character attributes β termcap:--n= 0normal attribute (all off)n= 1bold (highlight)n= 4underscore (if supported by HW)n= 5blink (if supported by HW)n= 7reversen= 22remove boldn= 24remove underscoren= 25remove blinkn= 27remove reversen= 3Xset ANSI foreground color (see table)n= 4Xset ANSI background color (see table)- the color table, in order:
X=0black Β·X=1redX=2green Β·X=3brownX=4blue Β·X=5magentaX=6cyan Β·X=7light greyX=9reset to the normal color
--Β·E[sβ Save cursor position β termcap:sc--Β·E[uβ Restore saved cursor position β termcap:rc--Β·E[xβ Reset normal colors and attributes to their default values β termcap:----Β·E[nzβ Switch to virtual console n β termcap:----Β·E[1;nxβ Set normal ANSI background color to n (see table) β termcap:----Β·E[2;nxβ Set normal ANSI foreground color to n (see table) β termcap:----Β·E[3;nxβ Set normal video attribute directly to n (nfrom 0 to 255) β termcap:----Β·E[5;nxβ Set normal ANSI reverse background color to n (see table) β termcap:----Β·E[6;nxβ Set normal ANSI reverse foreground color to n (see table) β termcap:--- the color table for all of the above, in order:
n= 0black Β·n= 8dark greyn= 1red Β·n= 9light redn= 2green Β·n=10light greenn= 3brown Β·n=11yellown= 4blue Β·n=12light bluen= 5magenta Β·n=13light magentan= 6cyan Β·n=14light cyann= 7light grey Β·n=15white
- the color table for all of the above, in order:
--Β·E[7;nxβ Set normal reverse video attribute directly to n (nfrom 0 to 255) β termcap:----Β·E[=p;dBβ Set bell pitch (p) and duration (d) β termcap:--- pitch is in units of 840 nS
- duration is units of 0,1 S
--Β·E[=tCβ Set global cursor type (see table) β termcap:--t=0normal non-blinkingt=1normal blinkingt=2custom non-blinkingt=3custom blinkingt=4reset cursor (resets custom cursor shape and sets current cursor type to 0)t=5hide cursor
--Β·E[=s;eCβ Set custom cursor shape, wheresis the starting andeis the ending scanlines of the cursor β termcap:----Β·E[=s;e;dCβ Same as above, exceptdspecifies the direction β termcap:--- if
0, scanlines are counted from the top to the bottom - if
1, from the bottom to the top
- if
--Β·E[=tSβ Set local cursor type (see table) β termcap:--t=0normal (global) β termcap:vet=1invisible β termcap:vit=2very visible β termcap:vs
--Β·E[=nAβ Set the border color to n (see table) (if supported by HW) β termcap:----Β·E[=nFβ Set normal foreground color to n (see table) β termcap:----Β·E[=nGβ Set normal background color to n (see table) β termcap:----Β·E[=nHβ Set normal reverse foreground color to n (see table) β termcap:----Β·E[=nIβ Set normal reverse background color to n (see table) β termcap:--- the color table for the
E[=nA/E[=nF/E[=nG/E[=nH/E[=nIcrew, in order:n= 0black Β·n= 8dark greyn= 1blue Β·n= 9light bluen= 2green Β·n=10light greenn= 3cyan Β·n=11light cyann= 4red Β·n=12light redn= 5magenta Β·n=13light magentan= 6brown Β·n=14yellown= 7light grey Β·n=15white
- the color table for the
note: the firstEin the sequences stands for ESC (0x1b) π do not forget her, she is doing so much work
π AUTHORS π
SΓΈren Schmidt <sos@FreeBSD.org> β the icon who wrote all this π
and that's the whole page bestie π«Ά this one came from Debian, dated October 6, 2000 (yes, a vintage β¨), and it lives in section SCREEN(4). go forth and switch consoles responsibly ππ
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms