Termcap

Termcap ("terminal capability") is a legacy software library and database used on Unix-like computers that enables programs to use display computer terminals in a device-independent manner, which greatly simplifies the process of writing portable text mode applications. It was superseded by the terminfo database used by ncurses, tput, and other programs.

Bill Joy wrote the first termcap library in 1978[1][2] for the Berkeley Unix operating system; it has since been ported to most Unix and Unix-like environments, even OS-9.[3] Joy's design was reportedly influenced by the design of the terminal data store in the earlier Incompatible Timesharing System.[4][better source needed][dubiousdiscuss]

A termcap database can describe the capabilities of hundreds of different display terminals. This allows programs to have character-based display output, independent of the type of terminal. On-screen text editors such as vi and Emacs are examples of programs that may use termcap. Other programs are listed in the Termcap category.

Examples of what the database describes:

  • how many columns wide the display is
  • what string to send to move the cursor to an arbitrary position (including how to encode the row and column numbers)
  • how to scroll the screen up one or several lines
  • how much padding is needed for such a scrolling operation.
  1. ^ Peter H. Salus, "The history of Unix is as much about collaboration as it is about technology", Byte, October 1994.
  2. ^ Kenneth C. R. C. Arnold and Elan Amir, "Screen Updating and Cursor Movement Optimization: A Library Package"
  3. ^ Joel Mathew Hegberg (November 1994). "Tackling Termcap, Part I". OS-9/OSK Answers!. Retrieved 26 April 2021.
  4. ^ Mark Crispin (7 Oct 1998). "Re: KL Console Commands". Newsgroupalt.sys.pdp10.