Super User is a question and answer site for computer enthusiasts and power users. 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

Every time I execute a command in, the command prints in the beginning of the first output line like this:

> ls 
lsfile1 file2 file3

This only happens in, for example does not do this.

What causes this? How can I fix it?

My .zshrc

export LANG=en_US.UTF-8
export TERM=screen-256color
source $ZSH/
plugins=(git npm node github brew nyan)
share|improve this question
Can you show the full text of what you see when you open a new terminal window, up to and including the prompt? Are you comfortable doing something like nano ~/.bash_profile? – beroe Sep 18 '13 at 23:58
I see ➜ ~ . Yeah I'm comfortable doing that - but prefer vi :). I probably should've mentioned I'm using ZSH. The behaviour still differs between and though. I tried switching to bash in - the problem does NOT exist with bash. I can't find anything odd in my .zshrc. – Morgan Sep 19 '13 at 5:45
If you are comfortable doing it, you should probably post your .zshrc file in your question, and maybe the output of set. Did you select zsh in the terminal prefs or via chsh? – beroe Sep 19 '13 at 6:02
Did the first, set output is huge though so I'd prefer not to post it. What might I be looking for in there. I used chsh. – Morgan Sep 19 '13 at 6:08

What does echo $PROMPT_COMMAND or trap return?

Check your shell configuration files:

cat ~/.bash_profile ~/.profile ~/.bashrc ~/.bash_login /etc/profile /etc/bashrc

Are both Terminal (in the Startup tab) and iTerm (in Profiles > your profile > General > Command) set to open new shells with the default login shell?

share|improve this answer
The commands return: ➜ ~ echo $PROMPT_COMMAND echo ➜ ~ trap trap% Both are set to open with default login shell, for me being zsh. – Morgan Sep 19 '13 at 5:47

This can happen sometimes if you've resized the Terminal window. That might be the answer to your first question; but, if you're seeing this for every command, even after opening a new Terminal window and not resizing it, it's unlikely to be related. (with a disclaimer that if it could also be related to the full-screen behavior in Mountain Lion)

And, I don't know about the second part. None of command+k, ctrl+l, clear, or reset ever seem to work for me when I encounter similar issues.

share|improve this answer
I get it for all commands, in new windows as well. – Morgan Sep 19 '13 at 5:46

According to this thread, and this related question, it is due to xterm settings being passed by oh-my-zsh or one of its themes. The solutions varied, so you will have to try both. Maybe the .tmux.conf one first?

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .