GNU bug report logs -
#20484
25.0.50; Directory tracking in ansi-term broken.
Previous Next
Full log
Message #81 received at 20484 <at> debbugs.gnu.org (full text, mbox):
Paul Eggert <eggert <at> cs.ucla.edu> writes:
> On 04/07/2016 09:07 AM, Phillip Lord wrote:
>> Well, I need to scope this. If the issue is tcsh and bash, then I will
>> look at both. I cannot, of course, look at any arbitrary program which
>> might be affected.
>
> I think we'd be OK if we work with the "common" shells. But that would include
> zsh, whose current FAQ says the following:
>
> Probably the most reliable way of dealing with this is to look for
> the environment variable `$EMACS', which is set to `t' in
> Emacs' shell mode. Putting
>
> [[ $EMACS = t ]] && unsetopt zle
>
> in your .zshrc should be sufficient.
>
> So here it's not merely a matter of fixing zsh, it's also fixing all the
> users' .zshrc files that are following this (obsolescent) advice.
>
> So far we've looked at three shells (bash, tcsh, zsh), and found compatibility
> issues with all three. This is not a good sign.
So, bash has a command line option to achieve the same thing as EMACS=t.
I've checked tcsh and as far as I can tell, here, there is no clear
solution. EMACS=t is used, and it's deep in the init code. In my hands,
directory tracking in tcsh does not work in ansi-term either way.
Zsh does not, AFAICT, use EMACS=t (it's hard to be sure searching
through the code, since most instances of "emacs" refer to zsh's
emulation of Emacs). In fact, though, as the FAQ entry you found shows,
zsh actually does this...
/* unset zle if using zsh under emacs */
if (!strcmp(term, "emacs"))
opts[USEZLE] = 0;
which, according to the faq is behaviour from < Emacs-19.29.
So, zsh users already explicitly tell their zsh what to do.
Possible solutions:
1) For bash, launch with -o emacs, or call set -o emacs after launch.
2) zsh, launch and call unsetopt zle.
3) For tcsh, EMACS=t only needs to be correct during init. So, EMACS=t,
launch tcsh, set EMACS=what-ever-it-was-before.
4) Everything else -- move the "call-process" call to a single function
which people can advice as they choose.
Phil
This bug report was last modified 6 years and 346 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.