How do you ask a terminal what it is?

Jim Walker jwwalker at opusc.csd.scarolina.edu
Thu Jan 24 06:06:07 AEST 1991


In article <383 at bria>  writes:
>
>As for a better solution, why not simply make a termcap (or terminfo)
>defintion for a terminal type 'regis'.  Then, all you need is something
>as simple as:
>
>	if ( strcmp(getenv("TERM"),"regis") == 0 ) {
[etc]
>If you want some more specific help, then send me email.
>-- 
>Michael Stefanik, Systems Engineer (JOAT), Briareus Corporation
>UUCP: ...!uunet!bria!mike

(I would have sent you email, but neither I nor my mail reader understand
how to reply to your message.)

The trouble with this suggestion is, how does the TERM environment variable
get set correctly?  It's normally set with the .login or .cshrc file,
right?  The trouble is that some of our users, especially grad students
without terminals of their own, may log in on one type of terminal one day
and another type the next.  I myself have a VT330 (a ReGIS terminal) at
work and a VT100 emulator at home.

One could argue that something in the .login, rather than individual
programs, should worry about querying the terminal.

Anyway, I did get the details worked out, with the help of some GNU Emacs
source code.
-- 
  -- Jim Walker 76367.2271 at compuserve.com



More information about the Comp.unix.programmer mailing list