I have an odd problem with zsh when I switch between shells in a particular way:

Option 1 (works well):

I start a zsh shell. I switch to tcsh with /bin/tcsh, and I switch back to zsh with /bin/zsh

If I then run:

> ls

I get:

./  ../ file1 file1 file3

Option 2 (problematic):

I start a zsh shell. I switch to tcsh with:

exec env -i HOME=$HOME TERM=$TERM DISPLAY=$DISPLAY /bin/tcsh.

and I then switch back to zsh with /bin/zsh. If I then enter any commands, the zsh shell echoes the command and then the result. Using the same example as before:

> ls

2;ls --color=yes -aF1;./ ../ file1 file2 file3

In other words, zsh shows 2;COMMAND 1; and then the output, which is of course very different from what I was getting with Option 1.

What's even more strange is that this only happens within ansi-term or multi-term terminals in Emacs, and not under gnome-terminal.

What else can I do to diagnose the problem? Any thoughts on what may be causing this?

Update:

My .cshrc prompt is

set prompt = "> "
  • 1
    Escape code to update the title of your terminal – Ulrich Dangel May 5 '13 at 8:17
  • what is $prompt set to in tcsh? Do tcsh -V and zsh -x give a clue? – Stéphane Chazelas May 5 '13 at 13:36
  • Thanks @UlrichDangel. What do you mean by that? – Amelio Vazquez-Reina May 5 '13 at 21:40
  • Thanks @StephaneChazelas. I updated the OP with prompt info. Is there anything in particular that you recommend I pay attention to in the trace? – Amelio Vazquez-Reina May 5 '13 at 21:47
  • 1
    @user815423426 something tries to update the title of your terminal to show the command you are running. as probably neither ansi-term nor multi-term terminal supports this they just show the escape codes instead of updating the title – Ulrich Dangel May 6 '13 at 12:35

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.