terminfo vs. termcap
Philip A. Gross
pag at tcsc3b2.UUCP
Fri Jan 20 04:21:57 AEST 1989
In article <6966 at june.cs.washington.edu>, mckenzie at june.cs.washington.edu (Neil McKenzie) writes:
> I've just brought up X11 on A/UX (MacII). It works just fine, except that
> there was no terminal description for "xterm". So I thought, no big
> deal, just ftp over /etc/termcap from another machine. Imagine
> to my surprise that it didn't work. I realized that there was something
> fishy, and stumbled onto terminfo, which is the SysV (and therefore A/UX)
> way of doing things.
>
> This is really dumb. It is really mysterious why there is even an
> /etc/termcap file and even a man page to go with it because the
> termcap file is just ignored. What is even more unfriendly is that
> the source descriptions are compiled into an unreadable format. This
> makes it very hard to study examples, since the source formats seem
> to be unavailable (or just well hidden), and reading the binary
> is no help.
>
The terminfo database found in /usr/lib/terminfo is a rather clever
means of recording the characteristics of a terminal, printer, or
with non-HDB uucp, even modem information. In order to create a new
definition, enter the appropriate information as described in the manual
page terminfo(4) in section 4 of the _Programmer's Reference Manual_. If
you have one. Once you have entered the appropriate information, you will
need to compile it using the command tic(1M). This will generate the
appropriate terminfo entries for the terminal you defined. Note that the
terminfo entry(s) is found in a directory under /usr/lib/terminfo that
begins with the first character of the terminal name.
If you have the need to print out or look at an already compiled terminfo
entry, there is the command infocmp which will print a compiled terminfo
entry in /etc/termcap format.
The older /etc/termcap file was used in earlier days of UNIX for the
definition of terminal characteristics, but has been replaced with the
terminfo database because the latter is quicker and more efficient to
process by curses(3X) than the /etc/termcap file. The only reason that
the /etc/termcap is still around is to retain compatibility with older
software that still uses the /etc/termcap file for the definition of
terminal capabilities. Someday, AT&T will probably go through with their
threat of removing the /etc/termcap file from future releases of UNIX V.
> I've tried to construct a terminfo file from the termcap file, but
> it doesn't quite work right, but it looks ok.
>
> So, can someone post a terminfo source file for xterm? Or, are there
> source examples to study (such as vt100 which is pretty close to xterm)?
>
Here, you will find the terminfo for a DEC vt100, I couldn't find any
definition for xterm.
#ident "@(#)/usr/src/lib/terminfo/dec.ti.sl 1.4 3.0 12/06/85 33624 "
# # --------------------------------
#
# dec: DEC (DIGITAL EQUIPMENT CORPORATION)
#
# Manufacturer: DEC (DIGITAL EQUIPTMENT CORP.)
# Class: II
#
# Info:
# Note that xenl glitch in vt100 is not quite the same as concept,
# since the cursor is left in a different position while in the
# weird state (concept at beginning of next line, vt100 at end
# of this line) so all versions of vi before 3.7 don't handle
# xenl right on vt100. The correct way to handle xenl is when
# you output the char in column 80, immediately output CR LF
# and then assume you are in column 1 of the next line. If xenl
# is on, am should be on too.
#
# I assume you have smooth scroll off or are at a slow enough baud
# rate that it doesn't matter (1200? or less). Also this assumes
# that you set auto-nl to "on", if you set it off use vt100-nam
# below.
#
# The padding requirements listed here are guesses. It is strongly
# recommended that xon/xoff be enabled, as this is assumed here.
#
# The vt100 uses rs2 and rf rather than is2/tbc/hts because the
# tab settings are in non-volatile memory and don't need to be
# reset upon login. Also setting the number of columns glitches
# the screen annoyingly. You can type "reset" to get them set.
#
vt100|vt100-am|dec vt100 (w/advanced video),
mir, msgr, cr=^M, cud1=^J, ind=^J, bel=^G, cols#80, lines#24, it#8,
clear=\E[H\E[J$<50>, cub1=^H, am, cup=\E[%i%p1%d;%p2%dH$<5>,
cuf1=\E[C$<2>, cuu1=\E[A$<2>, el=\E[K$<3>, el1=\E[1K$<3>, ed=\E[J$<50>,
cud=\E[%p1%dB, cuu=\E[%p1%dA, cub=\E[%p1%dD, cuf=\E[%p1%dC,
smso=\E[1;7m$<2>, rmso=\E[m$<2>, smul=\E[4m$<2>, rmul=\E[m$<2>,
bold=\E[1m$<2>, rev=\E[7m$<2>, blink=\E[5m$<2>, sgr0=\E[m^O$<2>,
sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t^N%e^O%;,
rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, smkx=\E[?1h\E=, rmkx=\E[?1l\E>,
enacs=\E(B\E)0, smacs=^N, rmacs=^O,
acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
tbc=\E[3g, hts=\EH, home=\E[H, ht=^I, ri=\EM$<5>,
kcuu1=\EOA, kcud1=\EOB, kcuf1=\EOC, kcub1=\EOD, kbs=^H,
# Info:
# This is how the keypad gets assigned.
# PF1 PF2 PF3 PF4
kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS,
# 7 8 9 '-' does not send anything on my terminal.
kf9=\EOw, kf10=\EOx, kf0=\EOy,
# 4 5 6 ,
kf5=\EOt, kf6=\EOu, kf7=\EOv, kf8=\EOl,
# 1 2 3
ka1=\EOq, kb2=\EOr, ka3=\EOs,
# 0 . ENTER
kc1=\EOp, kc3=\EOn, kent=\EOM,
#
vt#3, xenl, xon, sc=\E7, rc=\E8, csr=\E[%i%p1%d;%p2%dr,
vt100-nam|vt100 w/no am (w/advanced video),
am@, xenl@, use=vt100-am,
# Info:
# Ordinary vt100 in 132 column ("wide") mode.
#
vt100-w|vt100-w-am|dec vt100 132 cols (w/advanced video),
cols#132, lines#14, rs2=\E>\E[?3h\E[?4l\E[?5l\E[?8h, use=vt100-am,
vt100-w-nam|vt100-nam-w|dec vt100 132 cols (w/advanced video),
cols#132, lines#14, rs2=\E>\E[?3h\E[?4l\E[?5l\E[?8h, vt@, use=vt100-nam,
# Info:
# vt100's with no advanced video.
#
vt100-nav|vt100 without advanced video option,
sgr@, smso=\E[7m , rmso=\E[m , xmc#1,
smul@, rmul@, bold@, rev@, blink@, sgr0@, use=vt100,
vt100-nav-w|vt100-w-nav|dec vt100 132 cols 14 lines (no advanced video option),
lines#14, cols#132, use=vt100-nav,
# Info:
# vt100's with one of the 24 lines used as a status line.
# We put the status line on the top.
#
vt100-s|vt100-s-top|vt100-top-s|vt100 for use with sysline,
lines#23, is2=\E7\E[2;24r\E8, clear=\E[2;1H\E[J$<50>, home=\E[2;1H,
dsl=\E7\E[1;24r\E8,
cup=\E[%i%p1%{1}%+%d;%p2%dH$<5>, csr=\E[%i%i%p1%d;%p2%dr,
hs, eslok, tsl=\E7\E[1;%p1%dH\E[1K, fsl=\E8, use=vt100-am,
# Info:
# Status line at bottom.
# Clearing the screen will clobber status line.
#
vt100-s-bot|vt100-bot-s|vt100 for use with sysline,
lines#23, is2=\E[1;23r\E[23;1H, dsl=\E7\E[1;24r\E8,
hs, eslok, tsl=\E7\E[24;%p1%dH\E[1K, fsl=\E8, use=vt100-am,
Best of luck with your MAC II and A/UX(tm).
========================================+======================================
Philip A. Gross |
The Computer Solution Co., Inc. | I haven't heard what I have
1009 Sycamore Square, P.O. Box 716 | to say about that yet.
Midlothian, VA 23113-0716 |
Voice: (804)794-3491 |
----------------------------------------+--------------------------------------
INTERNET: pag%tcsc3b2 at wb3ffv.ampr.org
USENET: ...!ames!haven!aplcen!wb3ffv!tcsc3b2!pag
UUCP: tcsc3b2!pag (804)794-1514
ATTMAIL: attmail!tcsc3b2!pag
*******************************************************************************
The opinions expressed here are strictly mine and nobody elses.
===============================================================================
More information about the Comp.unix.questions
mailing list