terminfo
terminfo is a Unix database of terminal capabilities — what ANSI escape sequences each terminal type accepts for clearing, cursor moves, colors, and so on. Created by Mary Ann Horton at Bell Labs in 1981–1982 as a replacement for BSD termcap, it ships compiled per-terminal entries (via the tic compiler) selected by the TERM environment variable. terminfo underpins ncurses and the curses libraries on essentially every modern Unix.
terminfo is a database of terminal capabilities used by Unix curses-style libraries to drive terminals portably. For each terminal type (identified by short names like ``xterm``, ``vt100``, ``screen-256color``) the database records what ANSI escape sequences that terminal understands for operations like clearing the screen, moving the cursor, entering bold mode, or setting a color. Programs look up capabilities by symbolic name (``clear``, ``cup``, ``smso``, ``setaf``) and emit the correct byte sequence for whatever ``$TERM`` says the user is using. terminfo was created by Mary Ann Horton (then Mark Horton) at Bell Labs in 1981–1982 as a replacement for the earlier BSD termcap database. It was announced at USENIX Summer 1982 and shipped as part of UNIX System V Release 2. The two formats serve the same purpose but differ in storage: termcap is a single flat text file (``/etc/termcap``) parsed at runtime, while terminfo source files are compiled by ``tic(1)`` into per-terminal binary blobs stored under directories like ``/usr/share/terminfo/x/xterm``. Compilation makes lookups dramatically faster on systems with many terminal types. The runtime selects a description based on the ``TERM`` environment variable, optionally overridden by ``TERMINFO`` or a colon-separated ``TERMINFO_DIRS`` list. Misconfigured ``TERM`` is a classic cause of "broken backspace" or "vi displays garbage" complaints — the terminal does X but terminfo thinks it does Y, so the wrong escape sequences are emitted. ``infocmp`` decompiles entries for inspection; ``tput`` queries individual capabilities from the shell. Terminfo underpins ncurses (the dominant free curses implementation on Linux) and the curses libraries bundled with most commercial Unixes. BSD systems historically stuck with termcap longer but most have converged on terminfo or shipped compatibility shims. Today the database is essentially a museum-and-living-system hybrid: most entries describe terminals nobody owns anymore, but a handful (``xterm``, ``screen``, ``tmux``, ``linux``, ``vt100``) cover almost all real-world use.