This is a program I wrote when I was trying to find out why emacs and micro-
emacs got very confused when running under screen.
It reads termcap entries via tgetstr/tgetnum/tgetflag and prints the entries
and descriptions to standard output. Output can be sorted by entry (-s) or
by description (-ss).
I also had a look at the kernel (console.c Linux 0.99pl4) to find out
what sequences are recognized by Linux (-i).

There are some special flags for debugging:
 -a    Show ALL entries known to the program
 -u    Show all entries found that are UNKNOWN to the program
 -g    Show all entries mentioned in GNUemacs termcap.info
 -gg   Show all entries not mentioned in GNUemacs termcap.info
 -i    Show all vtXXX sequencies known to the program and implemented in
       Linux
 -s    Sort by capability name
 -ss   Sort by description

(I know these flags are a bit confusing!)

Examples:

1. Compare termcap entries for vt100 and vt200:

tci -s vt100 >tci.vt100
tci -s vt200 >tci.vt200
diff -u tci.vt100 tci.vt200 | more

2. Show all 'strange' capabilities (not mentionned in GNU termcap.info) of
   the current termial terminal type:

tci -gg | more

3. Check for unknown capabilities:

tci -u | more

Included is a part of my /etc/termcap that works for my confguration.

*** READ THIS *** READ THIS *** READ THIS *** READ THIS *** READ THIS *** READ
If you insert my termcap into yours, and programs that worked before are get-
ting confused then you were caught by the 'silly 1024 byte restriction`.
There are still a lot of programs (standard microemacs, BSD telnet, screen)
that call tgetent with a buffer of 1024 bytes. And this is not enough for long 
terminal desriptions. So you will get a segmentation violation (if you are 
lucky) or the programs will react very strange.

                       Wolfgang Thiel  February 1993
