TERMCAP / TERMINFO difference?
Doug Gwyn
gwyn at smoke.BRL.MIL
Mon Oct 1 12:58:03 AEST 1990
In article <24636 at uflorida.cis.ufl.EDU> ruck at beach.cis.ufl.edu () writes:
>Please give me a history lesson --
Ok: The termcap scheme was invented at UCB in support of the multi-terminal
text editor "vi". "vi"'s display management routines were eventually
extracted into a separate "curses" library for use by other applications.
One of the UCB termcap/curses maintainers, Mark Horton, decided that the
termcap scheme had too many restrictions and other deficiencies, including:
- scanning /etc/termcap to find the terminal description took too long
- tgoto()-like capabilities were insufficiently programmable to cover
some more recent terminal designs
- 2-character capability names were becoming quite strained
Terminfo (and its associated "curses" library) was designed to address
these concerns. It supports a superset of the termcap attributes, offers
a programmable stack machine for tgoto()-like capabilities, and accesses
the terminal description directly (actually, the kernel does have to do a
search for mathcing entries in two directories, but this is much faster
than the old termcap contents search). The terminal description is
precompiled into a binary form for faster loading.
Mark took "terminfo" to AT&T with him, and it was adopted for UNIX System
V Release 2 as a replacement for "termcap" (which was temporarily still
supported in SVR2). UCB, however, stuck with termcap for quite a while
(through 4.3BSD at least), merely bringing the termcap manual entry up to
date with the SVR2 version of terminfo insofar as possible (I was the
editor for the 4.3BSD termcap manual entry). Pavel Curtis provided his
own public-domain implementation of terminfo/curses, but I don't think it
really caught on.
Virtually all applications that use one or another of these facilities
are built to use just one of them; it would be difficult to do otherwise,
since the implementations of the curses library functions differs somewhat
for the two schemes. There is also no automatic mechanism for keeping
terminal descriptions in sync between the two databases. There are some
tools that aid in converting descriptions from one form to the other,
however. Generally, AT&T seems to think that nobody should be using
termcap at this point, and that terminfo is the only supported scheme.
More information about the Comp.unix.questions
mailing list