[232] in testers
Re: if (($term == switch) || ($term == network)) in $INITDIR/login
daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Wed Aug 9 19:30:08 1989
From: <qjb@ATHENA.MIT.EDU>
Date: Wed, 9 Aug 89 19:29:49 -0400
To: testers@ATHENA.MIT.EDU
In-Reply-To: [0231] in testers
I already sent this to athena-ws and to jik (twice)
You're not looking carefully enough, I think.
The old code had exactly the same functionality but did what it
did much less efficiently:
if ($term !~ xterm*) then
if (! $?def_term ) then
set def_term = vt100
endif
set noglob; \
eval `tset -s -I -Q -m "switch:?${def_term}" -m "network:?${def_term}"` \
|| unset noglob
endif
The first line obviously means proceed only if the terminal type
is not some form of xterm. The tset command, however, means if
the terminal type is switch or network, ask what to change it
too using $def_term as the default.
This means that whenever your terminal type is not xterm, a tset
will be executed even though it will do nothing unless the
terminal type is network or switch. The new code only does the
tset when the terminal type is switch or network as well, but
checks this with shell builtins instead of with the tset
program. Then, since it already knows that we have network or
switch, it doesn't bother to tell tset to figure this out and
just tells it to ask the terminal type using $DEF_TERM as the
default.
if (($term == switch) || ($term == network)) then
# The standard terminal emulation is vt100. To use a different emulation,
# set the environmental variable DEF_TERM in your ~/.environment file to
# to the device you want to emulate (one that the system will recognize).
if (! $?DEF_TERM) setenv DEF_TERM vt100
set noglob; eval `tset -s -I -Q "?${DEF_TERM}"` || unset noglob
endif
Jay