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

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