<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9"> <TITLE>Visible bell mini-Howto: Basic Concepts About Termcap and Terminfo</TITLE> <LINK HREF="Visual-Bell-6.html" REL=next> <LINK HREF="Visual-Bell-4.html" REL=previous> <LINK HREF="Visual-Bell.html#toc5" REL=contents> </HEAD> <BODY> <A HREF="Visual-Bell-6.html">Next</A> <A HREF="Visual-Bell-4.html">Previous</A> <A HREF="Visual-Bell.html#toc5">Contents</A> <HR> <H2><A NAME="s5">5. Basic Concepts About Termcap and Terminfo</A></H2> <P>The file <CODE>/etc/termcap</CODE> is a text file that lists the <CODE>term</CODE>inal <CODE>cap</CODE>abilities. Several applications use the <CODE>termcap</CODE> information to move the cursor around the screen and do other screen-oriented tasks. <CODE>tcsh</CODE>, <CODE>bash</CODE>, <CODE>vi</CODE> and all the <CODE>curses</CODE>-based applications use the <CODE>termcap</CODE> database. <P>The database describes several terminal types. The <CODE>TERM</CODE> environment variable selects the right behaviour at run-time, by naming a <CODE>termcap</CODE> entry to be used by applications. <P>Within the database, each capability of the terminal appears as a two-letter code and a representation of the actual escape sequence used to get the desired effect. The separator character between different capabilities is the colon (":"). As an example, the audible bell, with code "bl", usually appears as "<CODE>bl=^G</CODE>". This sequence tells that the bell sound is obtained by printing the control-G character, the ASCII BEL. <P>In addition to the <CODE>bl</CODE> capability, the <CODE>vb</CODE> capability is recognized. It is used to represent the "visible bell". <CODE>vb</CODE> is usually missing in the <CODE>linux</CODE> entry of the <CODE>termcap</CODE> file. <P>Most modern applications and libraries use the <CODE>terminfo</CODE> database instead of <CODE>termcap</CODE>. This database uses one file per terminal-type and lives in <CODE>/usr/lib/terminfo</CODE>; to avoid using huge directories, the description of each terminal type is stored in a directory named after its first letter; the <CODE>linux</CODE> entry, therefore, is <CODE>/usr/lib/terminfo/l/linux</CODE>. To build a <CODE>terminfo</CODE> entry you'll ``compile'' the <CODE>termcap</CODE> description; refer to the <CODE>tic</CODE> program and its manual page. <P> <HR> <A HREF="Visual-Bell-6.html">Next</A> <A HREF="Visual-Bell-4.html">Previous</A> <A HREF="Visual-Bell.html#toc5">Contents</A> </BODY> </HTML>