esa@kvvax4.UUCP (Esa K Viitala) (01/04/70)
This is what we do in
.profile:
# set up for termcap database (temporary)
TERM=`/usr/etc/termtype`
export TERM
tset
.login:
# set up terminal stuff
set term=`/usr/etc/termtype`
tset -Q
and /usr/etc/termtype looks as follows (it's a bit heavy, but)
we've got the LAN difficulties as well. We use
Interactive System's INed screen editor and have to
set up a profile file for it too. This is recognised by
tty number suffix in the filename, as you will understand from
the listing here:
#!/bin/sh
# @(#) termtype.sh 1.4
# * modified: Wed May 11 00:20:40 GMT+2:00 1983, by torj
# To give info about (account)groups.
# Modified: Jan 17 1984 by torj/D52, to print out accounts right.
#
set `/usr/etc/prgroup`
echo -n "
Current (account)group : $1
account: " > /dev/tty
sed -n "/^$1:/s/.*:\([0-9][0-9-]*\),.*/\1/p" /etc/group > /dev/tty
echo "
Valid group(s):" > /dev/tty
grep ",$USER" /etc/group | sed "s/:.*//" > /dev/tty
echo "
to change group use command 'accgrsw'" > /dev/tty
tty=`who am i | awk {'print $2'}`
INlib=/usr/lib/INed
if test "$tty" = "console"
then
echo "You can't run a display editor from console" >/dev/tty
echo "" ; # to clear TERM
exit 0
fi
while true
do
echo -n >/dev/tty "
The following terminals are supported:
0 other 3x tdv2230x
1 tdv2115 4 intextII
1x tdv2115x 5 nokia210
2 tdv2215 6 vt100
What terminal type do you have? "
read term
case ${term} in
0 | "")
term=""
break
;;
1 | tdv2115 | 2115)
term=2115
INtype=tdv2115.ied
break
;;
1x | tdv2115x | 2115x)
term=2115
INtype=tdv2115x.ied
break
;;
2 | tdv2215 | 2215)
term=2215
INtype=tdv2215.ied
break
;;
3 | tdv2230 | 2230)
term=2230
INtype=tdv2230.ied
break
;;
3x | tdv2230x | 2230x)
term=2230
INtype=tdv2230x.ied
break
;;
4 | intextII | intextII)
term=intext2
INtype=profile.it2
break
;;
5 | nokia | nokia210)
term=nokia210
INtype=nokia.ied
echo "Downloading the INed keyboard layout" >/dev/tty
/usr/local/setterm >/dev/tty </dev/tty
break
;;
6 | vt100)
term=vt100
INtype=vt100.ied
break
;;
esac
done
if test "${INtype}"
then
if test -r $INlib/profile.$tty
then
rm -f $INlib/profile.$tty
fi
ln $INlib/$INtype $INlib/profile.$tty
else
echo "You can't run a display editor from this terminal" >/dev/tty
fi
echo $term
All bright ideas are welcome!!
--
Esa K Viitala ({decvax,philabs}!mcvax!kvport!kvvax4!esa)
A/S Kongsberg Vaapenfabrikk, CTG4, P.O.Box 25, N-3601 Kongsberg
Norwayrjk@mgweed.UUCP (Randy King) (02/11/84)
[][][][][][][][] \______/\______/ How do *you* export TERM for termcap/terminfo? Do you *ask* for it verbatim, ala: echo "Term? \c"; read TERM; export TERM... Or do you do it in magic ways? I thought I had a magic way - I wrote this command years ago called tset that is invoked like: TERM=`/usr/lbin/tset`. What it does is disable canonical input, send out various X3.64 and private identify sequences then look at the result. If nothing comes back, or is not matched to the known sequences, then TERM=dumb. (Back in RT-11 days, I did this with an EMT 340). This was fine until we got our 60-some Teletype 5420's here. They all respond just like the vt100, but the vt100 termcap isn't just right. The 5420 termcap is great, but it doesn't work exactly right on the vt100. It was suggested that one store terminal ID's in the answerback message on each terminal, but that's cheating. So how about it? What else is being done out there in this regard? Randy King AT&T/CP-MG ihnp4!mgweed!rjk
guy@rlgvax.UUCP (Guy Harris) (02/11/84)
Berkeley UNIX has the "/etc/ttytype" file, which (for hardwired lines)
indicates what type of terminal is attached; "login" reads that file and
fills the TERM environment entry for you. We're running the System III
"init", "getty", and "login"; we just:
1) fixed "login" so that, instead of rudely stomping on the
environment, gently *adds* things (like HOME, etc.) to the
environment.
2) use "env" as the command in the line in "/etc/inittab" and
set TERM in the "inittab" line; i.e., you say things like
2:h0:c:env TERM=vt100 /etc/getty ttyh0 d
which has the same effect, namely that a user's terminal
type is automatically set when they log in.
The same trick will work with the System V "init" and "login", once you've
fixed "login". Of course, this doesn't help dial-ins, but except for
places like a certain large corporation which has an inordinate love for
1200 baud dial-up lines, 99% of a user's work is likely to be on a hardwired
terminal.
Guy Harris
{seismo,ihnp4,allegra}!rlgvax!guy
(BTW, if you think "/dev/ttyh0" sounds more like a Berkeley TTY name
rather than a USG tty name, you're right.)rjk@mgweed.UUCP (Randy King) (02/12/84)
Maybe I should expound a bit more. We have no way of identifying terminals wrt ports - everything, including dial-ins are on a hunting local area network (Sytek LocalNet/20) - so there is no way to identify the terminal in this manner. Now what? Randy King
darrelj@sdcrdcf.UUCP (Darrel VanBuer) (02/13/84)
/etc/ttytype is becoming less useful for many large companies with many computers,
as many companies now have terminal switches (or occasionally plugboards)
which provide high speed and switched connection (our VAX only knows
something useful about 2 lines, 1 is the console).
--
Darrel J. Van Buer, PhD
System Development Corp.
2500 Colorado Ave
Santa Monica, CA 90406
(213)820-4111 x5449
...{allegra,burdvax,cbosgd,hplabs,ihnp4,sdccsu3,trw-unix}!sdcrdcf!darrelj
VANBUER@USC-ECL.ARPAdavel@dciem.UUCP (Dave Legg) (02/14/84)
xxx
Hmm, our site has a Gandalf PACX data switch, and all terminals (except system
consoles) are wired through it. We have to rely on setting the TERM in the
users profile, possibly with the option of a question at login time to allow
someone not at his regular terminal to set TERM to something else. As
yet most of our users are not aware of the uses of TERM, since we run mostly
v7 stuff, but this will change as a VAX 750 comes on line. If anyone has a
good idea how we can get the systems to determine terminal types without
associating a terminal type with a specific terminal line, I would appreciate
hearing about it. Thanks in advance.
--
Dave Legg, DCIEM, Toronto, Ont. Canada. (416) 635-2065
{linus,ihnp4,uw-beaver,floyd}!utcsrgv!dciem!davel
{allegra,ihnp4,linus,decvax}!utzoo!dciem!davelhenry@utzoo.UUCP (Henry Spencer) (02/21/84)
About all you can do is to flame at the people who sold you your
network/frontend/concentrator about not giving your machine a way
to find out who's connected to what. The software inside the magic
boxes definitely knows what connections exist; if you could convince
it to tell you, you could get as far as knowing which terminal cable
a given login was from. Given some bookkeeping on which terminals
are where, this would solve the problem. But of course, the stupid
boxes won't talk. This is plain old brain-damaged software, and it
should be treated as such.
--
Henry Spencer @ U of Toronto Zoology
{allegra,ihnp4,linus,decvax}!utzoo!henrycrp@ccivax.UUCP (02/23/84)
On System 3 and System 5, the Bourne Shell looks in /etc/profile before $HOME/.profile. We use /etc/profile to set $TERM (by looking in /etc/ttytype for the terminal) Where /etc/profile looks like: TERM=`tty | sed 's,/dev/,,'` TERM=`grep $TERM /etc/ttytype` if [ "$TERM". = . ] ; then TERM=dumb else TERM=`echo $TERM | sed 's, .*,,'` fi export TERM and /etc/ttytype looks like: h19 tty00 vt100 tty01 Chuck Privitera Computer Consoles Inc. Rochester, NY