Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


My .cshrc prompt is

set prompt = "> "
share|improve this question
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
@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 posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.