termcap strangeness

Paul-Andre Panon panon at cheddar.ucs.ubc.ca
Fri Jul 6 06:54:48 AEST 1990


I posted this earlier but I didn't get any replies (possibly because the
Subject: line was completely inappropriate - oops).

When trying to track down some curious behaviour with Screen v2.0a and
vt100 terminals, a friend and I narrowed the problem down to strange
behaviour by the termcap facility as it is called from the ansi.c module.

 With the following TERMCAP entry (split up for your benefit):

setenv TERMCAP 'd0|vt100|vt100-am|vt100am:co#80:li#24:do=^J:cl=50\E[;H\E[2J:
sf=5\ED:le=^H:bs:am:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:ce=3\E[K:cd=50\E[J:
so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:
is=\E[1;24r\E[24;1H:rf=/usr/lib/tabset/vt100:
rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:ku=\EOA:kd=\EOB:
kr=\EOC:kl=\EOD:kb=^H:ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=5\EM:vt#3:
xn:sc=\E7:rc=\E8:cs=\E[%i%d;%dr:';

 tgetnum("co") and tgetnum("li") return 79 and 23 respectively.

when the TERMCAP entry is modified to contain ... :co#79:li#23: ...
tgetnum() returns the expected values of 79 and 23 for columns and rows.

i.e. When the termcap entry gives a value of 80 by 24, those values somehow
get 1 subtracted from them by the time you can retrieve them through tgetnum().
Could somebody shed a little light on how to tell when you have a 79x23 or an
80x24 screen (other than by duplicating the function of tgetenv() and friends)?

Is this a feature? and, if so, pray tell, what are its origins?

This is while working with BSD termcap on both an Apollo DN3500 running
Domain/OS and a Sun3/2xx(?) running SunOS v4.0.1_Export.

Paul-Andre

P.S. is this a termcap "feature" or should this message be in *.bugs?
--
    Paul-Andre_Panon at staff.ucs.ubc.ca        or    USERPAP1 at UBCMTSG 
or  Paul-Andre_Panon at undergrad.cs.ubc.ca     or    USERPAP1 at mtsg.ubc.ca
Looking for a .signature? "We've already got one. It is ver-ry ni-sce!"



More information about the Comp.unix.wizards mailing list