Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!samsung!zaphod.mps.ohio-state.edu!rpi!nisc.nyser.net!rodan!jdpeek From: jdpeek@rodan.acs.syr.edu (Jerry Peek) Newsgroups: comp.unix.questions Subject: Re: Private termcap entries Keywords: termcap private extra Message-ID: <1508@rodan.acs.syr.edu> Date: 10 Dec 89 16:37:38 GMT References: <340@charyb.COM> Reply-To: jdpeek@rodan.acs.syr.edu (Jerry Peek) Organization: Syracuse University, Syracuse, NY Lines: 50 In article <340@charyb.COM> dan@charyb.UUCP (Dan Mick) writes: > Is there a way to get extra, customized termcap entries without adding > to the system-wide termcap file? I've heard tell of putting a filename > in the TERMCAP environment variable, but I've never been able to get it > to work under SunOS. Can someone describe how this is supposed to work, In article <1989Dec10.025418.12733@eng.umd.edu> smaug@eng.umd.edu (Kurt Lidl) writes: > setenv TERMCAP ~username/termcap;set term=termname;tset > > This works for me, with the correct values for username and termname, > obviously. Under SunOS 4.01, 4.03 4.03c... This is great -- if only a few users do it. But the standard termcap file is big (on systems I've seen, at least) -- and if lots of users make their own copies, the disk fills up with a lot of mostly unused termcap data, just so users can add their private termcaps. Here's the answer I've come up with: - A directory called $HOME/.termcaps that has individual termcap definition files in it. For example, a file named "vt200" has a vt200 termcap, nothing else. - Code in my .profile file (I use ksh) that runs a shell function named "newterm" (see below). - A function named "newterm" that prompts the user for a terminal type and reads the answer, like "tset ?" does: TERM = (vt100) mytty Next, it checks to see if there's a termcap file in the $HOME/.termcaps directory. If there is, it does: TERM=mytty; TERMCAP=$HOME/.termcaps/mytty export TERM TERMCAP eval `tset -Qs "mytty"` Otherwise, it uses the default /etc/termcap by running: TERMCAP=/etc/termcap # RESET TO DEFAULT eval `tset -Qs "mytty"` In C-shell, the "newterm" shell function could be replaced with a file that you "source". Maybe: alias newterm source ~/csh/newterm It's nice to keep this code in a separate function or file, instead of embedding it in .profile or .login, because it lets you change terminal types after you're already logged in -- in case you made a mistake or change your mind. --Jerry Peek; Syracuse University Academic Computing Services; Syracuse, NY jdpeek@rodan.acs.syr.edu, JDPEEK@SUNRISE.BITNET +1 315 443-3995