Is there a terminal linux? I was experimenting with the machine to see how the virtual terminals work and when I echo $TERM it printed linux? Is this the default linux terminal? I tried searching for man pages on linux but only results about the operating system return.
3 Answers
Yes, there is a terminal description identified by the name linux
.
The infocmp
program will show you the details of a given terminal identifier. On Debian-based systems, infocmp
is in the ncurses-bin
package.
$ infocmp linux
# Reconstructed via infocmp from file: /lib/terminfo/l/linux
...
I've elided the escape codes for the capabilities. The man page for terminfo(5)
describes all the capabilities and what they mean.
The linux
terminal type is for the virtual consoles (also called virtual terminals or consoles), the text-mode consoles provided by Linux on PC-style hardware and reached by Alt+F1 or Ctrl+Alt+F1 and so on. Like all modern terminal types, it's a variant on VT100 and successors.
The TERM
environment variable identifies a terminal description. The name linux
has been used since its introduction in ncurses in 1994 as the preferred name for Linux console (rather than console
).
The ncurses terminal database defines more than a dozen variants, which some people use. In the terminal database, linux
is an alias for the version which most people are expected to use. Most people use the alias, for the usual reasons relating to terminal descriptions:
- while changing the alias is trivial (using infocmp and tic), most people don't modify their terminal database to point the alias to a different version,
- the name is used in the
getty
definitions (or equivalent), and again, most people don't change that, and of course - some programs (such as GNU ls) have their own idea about how to manage the
linux
name (and do not bother to use the terminal database).
Expanding on that last item, the initial version of GNU ls in June 1996 used these names for values of TERM
that supported color:
TERM linux
TERM console
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
TERM con80x28
TERM con80x30
TERM con80x43
TERM con80x50
TERM con80x60
TERM xterm
TERM vt100
using several "console" variants which were not ever provided by ncurses but apparently had some use. That likely motivated the comment in ncurses' INSTALL
(first seen in September 1995):
In various systems there has been a practice of designating the system
console driver type as `console'. Please do not do this! It
complicates peoples' lives, because it can mean that several different
terminfo entries from different operating systems all logically want to
be called `console'.
Regardless of use, none of those were dropped, and (for Linux console), only linux-c
was added (in 1999, versus 1996 in ncurses). The current file has for instance
TERM con[0-9]*x[0-9]*
TERM linux
TERM linux-c
Further reading: