[comp.unix.questions] Termcaps

zben@umd5 (Ben Cranston) (12/17/86)

> ...now that I have a termcap for my <x>, how do I get Unix (csh) to use it?

I have a load of different virtual terminal programs and several different
real terminals, so I not only have a bunch of nonstandard termcaps but I 
need to be able to easily switch them on the fly (as I physically move the
serial line plug from machine to machine).  Furthermore I use several Unix
machines, maintained by different (read non-cooperative) campus entities,
and so can never get them all to agree on a standard termcap nameset.  So
I ended up with this setup:

1. In .cshrc this alias is setup:

alias term 'setenv OLDTERM $TERM; setenv TERM \!*; source ~zben/bin/term'

2. The file "~zben/bin/term" contains this "source" script:

#! /no/shell/execution
# Do NOT execute me as a shell script.  
# I am designed to be called from the alias:
# alias term 'setenv OLDTERM $TERM; setenv TERM \!*; source me'
#
setenv TERMCAP ~zben/bin/termcaps
set noglob
set mert=(`tset -Q -S`)
setenv TERM $mert[1]
setenv TERMCAP "$mert[2]"
echo Terminal type is now $TERM \(was $OLDTERM\)
unset mert
unset noglob
unsetenv OLDTERM

3. The file "~zben/bin/termcaps" contains my own private termcaps.  Most
   are snarfed from the system termcap file, but *I* get to determine the
   names and any other spot changes needed.  I keep this stuff constant
   across the various Unix systems via "rdist".

At any time I can type:

% term <xxx>
Terminal type is now <xxx> (was <yyy>)

For those who are taking this verbatim, change the "zben" in the above to
your own userid...  Note the stuff has to be "source"d into the shell, it
cannot be done with a shell script because the changes to the environment
will not be properly propagated upward.

I also use baud rate to determine the initial terminal type, but techniques
for doing this are common knowledge...
-- 
                    umd5.UUCP    <= {seismo!mimsy,ihnp4!rlgvax}!cvl!umd5!zben
Ben Cranston zben @ umd2.UMD.EDU    Kingdom of Merryland UniSys 1100/92
                    umd2.BITNET     "via HASP with RSCS"

schumann@puff.WISC.EDU (Christopher Schumann) (12/17/86)

Thanks for all the help so far,
but now that I have Unix using my termcap (I have an Apple //c),
I find out that my computer needs linefeeds after CR to go to a new line.

ab|apple2e|Apple //e:\
        :bl=^G:bw:cd=4*^K:ce=4^]:cl=100^L:co#80:ho=^Y:is=^R^N:\
        :kd=^J:kl=^H:kr=^U:ku=^K:li#24:me=^N:mr=^O:ms:nw=100r:\
        :rs=^R^N:se=^N:sf=^W:so=^O:sr=^V:up=^_:bs:nc:
ap|apple2e-p|Apple //e via Pascal:cm=^^%r%+ %+ :tc=apple2e:
2e|Apple //e|Apple //e emulating vt52:\
        :cl=100\EH\EJ:tc=vt52:
This is the termcap, can anybody help me with this. I appreciate all the
letters, but don't have time to respond to each one.


Adv thanks ance.
Chris Schumann		schumann@puff.wisc.edu
"and there's five E's in 'Aiieeeee'"