[comp.sys.mac.comm] Looking for termcap entry for Zterm

erf@progress.COM (Eric Feigenson) (04/29/91)

Hi!  I don't know if this has come up before, so I apologize if this is a
old and tired question...

I need a termcap (terminfo would do, as well) for Unix that describes Zterm.
I know vt100 emulation "works" but the vt100 (and ansi) termcap entries on 
the systems I use force the window size to 24 lines, which is a bummer if my
window size has 58 lines (which it usually does).  Is there a way to ask Zterm
from Unix how many lines is on the window?  If so, does anyone have a termcap/
terminfo entry that does this?

Thanks in advance!  Please e-mail replies.

-EricF

--
Eric R. Feigenson			UUCP: mit-eddie!progress!erf
Progress Software Corp.		    Internet: erf@progress.com
5 Oak Park
Bedford, MA  01730

hhchou@nell.cs.umd.edu (Hui-Hsien Chou) (04/30/91)

In article <1991Apr29.161928.22100@progress.com> erf@progress.COM (Eric Feigenson) writes:

   I need a termcap (terminfo would do, as well) for Unix that
   describes Zterm.  I know vt100 emulation "works" but the vt100 (and
   ansi) termcap entries on the systems I use force the window size to
   24 lines, which is a bummer if my window size has 58 lines (which
   it usually does).  Is there a way to ask Zterm from Unix how many
   lines is on the window?  If so, does anyone have a termcap/
   terminfo entry that does this?

   Thanks in advance!  Please e-mail replies.

   -EricF

Sorry I post my reply to the net since I think this is a general
problem.

I don't know whether you can let Unix ask Zterm how many lines it has.
(Probably you can't do this, I guess.) But if your Zterm lines are
fixed (probably so, you won't change screen height very often.), say
58 lines, then there are some very easy ways to cure this problem.

Method 1.
	Just let your TERM be vt100, but put the following command in
your startup script (.cshrc, if you use csh.)
 
	stty rows 58

Method 2.
	Or let your TERM be aabbcc (or whatever you name.), and
TERMCAP be ~/.termcap, and put the file .termcap in your home directory.
The content of .termcap is listed at the end. Doing this way will have
the benefit of quicker startup (because you don't have to call the
command stty.) and flexibility of modifications (you may change your
column width to 132 in addition to lines be 58).

	Of course if you are the system administrator, you can just
modify your system termcap file under /etc accordingly. (I mean if you
OWN the computer, :-)

Appendix: Content of .termcap

d0|aabbcc|mac-am|zterm:\
	:am:\
	:al=\E[L:\
	:bl=^G:\
	:bs:\
	:cd=50\E[J:\
	:ce=3\E[K:\
	:cl=50\E[;H\E[2J:\
	:cm=10\E[%i%d;%dH:\
	:co#80:\
	:cr=^M:\
	:cs=\E[%i%d;%dr:\
	:dc=\E[P:\
	:dl=\E[M:\
	:do=^J:\
	:ei=\E[4l:\
	:ho=\E[H:\
	:im=\E[4h:\
	:is=\E[1;24r\E[24;1H:\
	:k1=\EOP:\
	:k2=\EOQ:\
	:k3=\EOR:\
	:k4=\EOS:\
	:kb=^H:\
	:kd=\EOB:\
	:ke=\E[?1l\E>:\
	:kl=\EOD:\
	:kr=\EOC:\
	:ks=\E[?1h\E=:\
	:ku=\EOA:\
	:le=^H:\
	:li#58:\
	:md=2\E[1m:\
	:mr=2\E[7m:\
	:mb=2\E[5m:\
	:me=2\E[m:\
	:mi:\
	:nd=\E[C:\
	:nl=^J:\
	:pt:\
	:rc=\E8:\
	:rf=/usr/lib/tabset/vt100:\
	:rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:\
	:sc=\E7:\
	:se=\E[m:\
	:so=\E[7m:\
	:sr=\EM:\
	:ta=^I:\
	:ue=\E[m:\
	:up=\E[A:\
	:us=\E[4m:\
	:vt#3:\
	:xn:

ostroff@Oswego.EDU (Boyd Ostroff) (05/01/91)

In article <1991Apr29.161928.22100@progress.com> erf@progress.COM (Eric Feigenson) writes:
>I need a termcap (terminfo would do, as well) for Unix that describes Zterm.
>I know vt100 emulation "works" but the vt100 (and ansi) termcap entries on 
>the systems I use force the window size to 24 lines, which is a bummer if my
>window size has 58 lines (which it usually does).  

Here's a 40 line termcap; just change the li# variable to any other size
you want (or the co# variable to any desired width).

vt100-40:\
	:cr=^M:do=^J:nl=^J:bl=^G:co#80:li#40:cl=50\E[;H\E[2J:\
	: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:\
	:rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\
	:rf=/usr/lib/tabset/vt100:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
	:ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:ta=^I:pt:sr=5\EM:vt#3:xn:\
	:sc=\E7:rc=\E8:cs=\E[%i%d;%dr:BO=\E[1m:EE=\E[m:\
	:KM=/usr/lib/ua/kmap.vt100:


Put this, and any other termcaps you'll want in a file named "termcap"
in your home directory.  With sh or ksh you do a 

	TERMCAP=$HOME/termcap;export TERMCAP
	TERM=vt100-40

I'll leave it to someone else to RTFM and come up with the proper csh
environment variables....

To further confuse things, some programs use termcap and others use terminfo.
Try the termcap stuff above and see if vi, more, rn, etc all work.  If not,
then you'll need to do the following:

1. Make a terminfo directory in your home directory:

	mkdir terminfo
	mkdir terminfo/v

2. Copy the standard vt100 termcap into it:

	cp /usr/lib/terminfo/v/vt100 terminfo/v

You will also need to create lettered subdirectories and copy any additional
terminfo's you use to them (this is because you'll be replacing the 
system's standard /usr/lib/terminfo entries with your own custom database).

3. Here's a terminfo file for a 40-line vt100.  Save it into a file called
"vt100-40.ti":


vt100-40|,
	mir, msgr, cr=^M, cud1=^J, ind=^J, bel=^G, cols#80, lines#40, 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,


4. Now compile the new terminfo listing:

	tic vt100-40.ti

Copy the compiled terminfo to ~/terminfo/v and you should be all set.

5.  Again, you'll need to add the following to your .profile:

	TERMINFO=$HOME/terminfo;export TERMINFO
	TERM=vt100-40

I *think* these are right.... at least they work for me.  Of course, if
you have root access on the unix machine, you can just add the termcap &
terminfo entries to the system's database.

BTW, the name vt100-40 was arbitrary - you can call your new terminal
description anything you want.  If you want more than 40 lines, just
set the "li#" (for termcap) or the "lines#" (for terminfo) to any value
you desire.

||||  Boyd Ostroff / Tech Director / SUNY Oswego Dept of Theatre / 315-341-2987
||||  Sys Admin at cboard.UUCP / Serving the Performing Arts / 315-947-6414/8N1
||||  ostroff@oswego.oswego.edu / cboard!ostroff@natasha.oswego.edu