The Linux keyboard and console HOWTO: The TERM variable

Next Previous Contents

## 11. The TERM variable

Many programs use the `TERM` variable and the database `/etc/termcap` or `/usr/lib/terminfo/*` to decide which strings to send for clear screen, move cursor, etc., and sometimes also to decide which string is sent by the users backspace key, function keys etc. This value is first set by the kernel (for the console). Usually, this variable is re-set by `getty`, using `/etc/ttytype` or the argument specified in `/etc/inittab`. Sometimes, it is also set in `/etc/profile`.

Older systems use `TERM=console` or `TERM=con80x25`. Newer systems (with ncurses 1.8.6) use the more specific `TERM=linux` or `TERM=linux-80x25`. However, old versions of `setterm` test for `TERM=con*` and hence fail to work with `TERM=linux`.

Since kernel version 1.3.2, the kernel default for the console is `TERM=linux`.

If you have a termcap without entry for linux, add the word linux to the entry for the console:

> `

>             console|con80x25|linux:\

> `

and make `/usr/lib/terminfo/l/linux` a copy of or symbolic link to `/usr/lib/terminfo/c/console`.

## 11.1 Terminfo

The terminfo entry for the linux console from ncurses 1.8.6 misses the entry `kich1=\E[2~`, needed by some programs. Edit the file and `tic` it.

Next Previous Contents