home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!usenet.ins.cwru.edu!agate!ames!biosci!COLORNET.COM!dfilip
- From: dfilip@COLORNET.COM
- Newsgroups: comp.os.coherent
- Subject: Re: Terminal question
- Message-ID: <9301280019.AA21642@net.bio.net>
- Date: 24 Jan 93 14:31:16 GMT
- Sender: daemon@net.bio.net
- Reply-To: "Coherent operating system" <COHERENT@INDYCMS.bitnet>
- Lines: 69
-
- Mike Tarrant writes :
- > My question is, at a system level, how does Coherent "know" that the
- >terminal at the end of /dev/com4pl is a vt100, or a wyse50, or tvi925?
- >I know there is the TERM environmental variable in my .profile file,
- >but if I make that the terminal type, it'll be wrong when I log-on at
- >the console (ansipc).
- > As far I have been able to determine, terminal type is tied to the
- >user, and I think it should be known only by the system. What am I
- >missing?
-
- You are not missing anything. Unfortunatly, I have not seen anything in the
- Unix world that querries terminals type as is found in VAX/VMS (where you
- can do SET TERM/INQUIRE which will send some escape sequences out, look at
- what comes back, and try to determine what type of terminal you have).
-
- In the Xenix (and I believe BSD) world, there is the cryptic tset command,
- which uses the file /etc/ttytype to do some mapping of lines to terminals,
- and also prompts for terminals on 'dial-up' lines. Here is what I have put in
- my /etc/profile to sort of emulate that :
-
- ===========================================================================
- defterm=vt100
-
- # determine terminal type
-
- device=`tty`
- termtype=`grep $device /etc/ttytype | awk '{print $1}'`
- if [ -z "$termtype" -o "$termtype" = "dialup" -a "$USER" != "nuucp" ]
- then
- echo -n "Terminal type [$defterm] : "
- read termtype
- if [ -z "$termtype" ]
- then
- export TERM=$defterm
- else
- export TERM=$termtype
- fi
- else
- export TERM=$termtype
- fi
- ===========================================================================
-
- And my /etc/ttytype looks like this :
-
- ansipc /dev/color0
- ansipc /dev/color1
- ansipc /dev/color2
- ansipc /dev/color3
- dialup /dev/com1fr
- vt100 /dev/com2l
- dialup /dev/com3l
- dialup /dev/com4l
-
- This maps terminals to lines, which is closer than terminals to users. However,
- for network and/or dial-in lines, it will prompt the user, and the user must
- know what the designation is in your /etc/termcap.
-
- Regards,
-
- Dave.
-
- --
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- = David E. Filip UUCP : dfilip@colornet.com =
- = ColorNet Information Systems CIS : 76430,3111 =
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- = If David Cutler had been a heavy drug user in the 60's, he probably =
- = would have written Unix instead ... =
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-