Glossary

Terminal

A terminal is a program (or historically, a physical device) that provides a text interface to a computer: a rectangle of characters, a keyboard input, and a set of control sequences for moving the cursor, colouring text, and handling special keys. Early Unix used hardware terminals—VT100, VT220, Wyse—connected via serial lines. Modern Linux uses terminal emulators: software like gnome-terminal, konsole, xterm, alacritty, kitty, and wezterm that draw a terminal on the graphical desktop.

The line between a terminal and the shell running inside it is often blurred in conversation. The terminal handles keystrokes and drawing; the shell (bash, zsh, fish) handles commands. Between them sits the pseudo-terminal (/dev/pts/N), a kernel device that makes the shell think it is talking to a real serial line. This layering is what makes it possible to run any shell in any terminal emulator.

Terminal behaviour is controlled by the TERM environment variable (usually xterm-256color these days) and a database called terminfo that tells programs how to do things like clear the screen or move the cursor on that terminal type. The venerable tput command queries it. For remote work over SSH, the server reads your TERM value to decide how to render curses-based programs like htop and vim.

Related terms: tty, Shell

Discussed in:

Also defined in: Textbook of Linux