Linux – Origin of /etc/termcap linux entry

consolehistorylinuxtermcapterminal

Why is there a type of $TERM called linux described in /etc/termcap? Why and when was it created and what's the point of it? Couldn't we just stay with vt-generic? Is linux just a customary name and a set of capabilities for a Linux console (like, say, etc or home are a customary names for directories under root and nobody cares) or were there any technical reasons behind when it was introduced?

Best Answer

The terminal description is named for Linux, which provides its own console emulator (as do several other kernels).

Except for FreeBSD, all of the Linux- and modern BSD-platforms get "termcap" by deriving it from the terminfo database in ncurses. Console entries are specific to the systems in which they are implemented (unlike many terminal emulators, which run on more than one platform).

A comment in ncurses 1.8.6 (October 1994) for the linux terminal description stated:

# Note that the statdard Linux console is now called 'linux' instead
# of 'console'. terminals with sizes other than 80x25 need to append
# their size to linux and add an entry like the one for 132x43 below

That was specific to Linux, but generalization followed as ncurses was ported.

In the ncurses sources, this section of INSTALL is very old (seen in 1.9.7a in November 1995), but not outdated:

    Naming the Console Terminal                                            

    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'.

    Please pick a name unique to your console driver and set that up
    in the /etc/inittab table or local equivalent.  Send the entry to the
    terminfo maintainer (listed in the misc/terminfo file) to be included
    in the terminfo file, if it's not already there.  See the
    term(7) manual page included with this distribution for more on
    conventions for choosing type names.

    Here are some recommended primary console names:

            linux   -- Linux console driver
            freebsd -- FreeBSD
            netbsd  -- NetBSD
            bsdos   -- BSD/OS

    If you are responsible for integrating ncurses for one of these
    distributions, please either use the recommended name or get back
    to us explaining why you don't want to, so we can work out nomenclature
    that will make users' lives easier rather than harder.

There is a section in the terminal database for these: ANSI, UNIX CONSOLE, AND SPECIAL TYPES, while there is no "vt-generic" description nor (given the differences across the variations), is there a plausible choice.

If you look for "vt-generic", likely you will find that only in less prevalent implementations such as Informix (seen in this file):

#   @(#)/etc/termcap    0.0 
#
#   Informix product aware termcap file
#
#   Author: Marco Greco, <marcog@ctonline.it>, Catania, Italy
#
#   Initial release: Jun 97
#   Current release: Jul 98
#
#   Absolutely no warranty -- use at your own risk
#
#   Notes: Adapted from the default Slackware termcap file:
#   added gs, ge, gb, ZG, ZA capabilities, shifted function keys
#   down by one, added ki, kj, kf, kg
#
#   Limit the size of each entry - 4gl apps core dump if applicable
#   entry too long
#
#   Entries other than vt's, console & xterm *untested*
#
# From: miquels@drinkel.ow.org (Miquel van Smoorenburg)
#
# Okay guys, here is a shorter termcap that does have most
# capabilities and is ncurses compatible. If it works for you
# I'd like to hear about it.

Further reading:

Related Question