home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / coherent / 7003 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  2.9 KB

  1. Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!usenet.ins.cwru.edu!agate!ames!biosci!COLORNET.COM!dfilip
  2. From: dfilip@COLORNET.COM
  3. Newsgroups: comp.os.coherent
  4. Subject: Re: Terminal question
  5. Message-ID: <9301280019.AA21642@net.bio.net>
  6. Date: 24 Jan 93 14:31:16 GMT
  7. Sender: daemon@net.bio.net
  8. Reply-To: "Coherent operating system" <COHERENT@INDYCMS.bitnet>
  9. Lines: 69
  10.  
  11. Mike Tarrant writes :
  12. >  My question is, at a system level, how does Coherent "know" that the
  13. >terminal at the end of /dev/com4pl is a vt100, or a wyse50, or tvi925?
  14. >I know there is the TERM environmental variable in my .profile file,
  15. >but if I make that the terminal type, it'll be wrong when I log-on at
  16. >the console (ansipc).
  17. >  As far I have been able to determine, terminal type is tied to the
  18. >user, and I think it should be known only by the system.  What am I
  19. >missing?
  20.  
  21. You are not missing anything. Unfortunatly, I have not seen anything in the
  22. Unix world that querries terminals type as is found in VAX/VMS (where you
  23. can do SET TERM/INQUIRE which will send some escape sequences out, look at
  24. what comes back, and try to determine what type of terminal you have).
  25.  
  26. In the Xenix (and I believe BSD) world, there is the cryptic tset command,
  27. which uses the file /etc/ttytype to do some mapping of lines to terminals,
  28. and also prompts for terminals on 'dial-up' lines. Here is what I have put in
  29. my /etc/profile to sort of emulate that :
  30.  
  31. ===========================================================================
  32. defterm=vt100
  33.  
  34. # determine terminal type
  35.  
  36. device=`tty`
  37. termtype=`grep $device /etc/ttytype | awk '{print $1}'`
  38. if [ -z "$termtype" -o "$termtype" = "dialup" -a "$USER" != "nuucp" ]
  39. then
  40.         echo -n "Terminal type [$defterm] : "
  41.         read termtype
  42.         if [ -z "$termtype" ]
  43.         then
  44.                 export TERM=$defterm
  45.         else
  46.                 export TERM=$termtype
  47.         fi
  48. else
  49.         export TERM=$termtype
  50. fi
  51. ===========================================================================
  52.  
  53. And my /etc/ttytype looks like this :
  54.  
  55. ansipc /dev/color0
  56. ansipc /dev/color1
  57. ansipc /dev/color2
  58. ansipc /dev/color3
  59. dialup /dev/com1fr
  60. vt100  /dev/com2l
  61. dialup /dev/com3l
  62. dialup /dev/com4l
  63.  
  64. This maps terminals to lines, which is closer than terminals to users. However,
  65. for network and/or dial-in lines, it will prompt the user, and the user must
  66. know what the designation is in your /etc/termcap.
  67.  
  68. Regards,
  69.  
  70. Dave.
  71.  
  72. --
  73. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  74. =   David E. Filip                UUCP   : dfilip@colornet.com              =
  75. =   ColorNet Information Systems  CIS    : 76430,3111                       =
  76. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  77. =    If David Cutler had been a heavy drug user in the 60's, he probably    =
  78. =                    would have written Unix instead ...                    =
  79. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  80.