xterm versions mangle
$SHELL in annoying ways
As of patch #301 (and
with changes since then), the canonical version of
xterm has some
unfortunate behavior changes surrounding the
variable and how
xterm interacts with it. The full details are
OPTIONS section, but the summary is that
xterm now clears
$SHELL if the
$SHELL value is not in
and sometimes even if it is. As far as I can tell, the decision
tree goes like this:
xtermis (explicitly) running something that is in
xterm /some/thing', not '
xterm -e /some/thing'),
$SHELLwill be rewritten to that thing.
xtermis running anything (including running
$SHELLitself via being invoked as just '
$SHELLis not in
/etc/shellsbut your login shell is,
$SHELLwill be reset to your login shell.
$SHELLwill be removed from the environment, resulting in a shell environment with
$SHELLunset. This happens even if you run plain '
xterm' and so
It is difficult for me to summarize concisely how wrong this is and
how many ways it can cause problems. For a start, this is a misuse
/etc/shells, per my entry on what it is and isn't;
/etc/shells is in no way a complete list of all of the shells (or
all of the good shells) that are in use on the system. You cannot
validate the contents of
that is not what
/etc/shells is there for.
xterm change causes significant problems for anyone with
their shell set to something that is not in
using an alternate personal shell (which
is not in
/etc/shells for obvious reasons), any program that
$SHELL is always set (historically a safe assumption),
and any environment that assumes
$SHELL is not reset when set to
something non-standard such as a captive or special purpose 'shell'.
(Not all versions of
chsh restrict you to what's in
for that matter; some will let you set other things if you really
ask them to.)
If you fall into one or more of these categories and you use
you're going to need to change your environment at some point.
Unfortunately it seems unlikely that this change will be reverted, so
if your version of Unix updates
xterm at all you're going to have it
sooner or later (so far only a few Linux distributions are recent enough
to have it).
PS: Perhaps this should be my cue to switch to
urxvt. However my
almost-default configuration of it is still just enough different
xterm to be irritating for me, although maybe I could fix
that with enough customization work. For example, I really want
its double-click selection behavior to exactly match
that's what my reflexes expect and demand by now. See also.
PPS: Yes, I do get quite irritated at abrupt incompatible changes in the behavior of long-standing Unix programs, at least when they affect me.