Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

> ls 
lsfile1 file2 file3

This only happens in Terminal.app, iTerm.app 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
PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin:/usr/local/git/bin:usr/local/sbin
source $ZSH/oh-my-zsh.sh
COMPLETION_WAITING_DOTS="true"
ZSH_THEME="robbyrussell"
ZSH=$HOME/.oh-my-zsh
PATH=/usr/local/bin:/usr/local/sbin:/Users/johan/Library/Python/2.7/bin:$PATH
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 Terminal.app and iTerm.app though. I tried switching to bash in Terminal.app - 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

3 Answers 3

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.