I switched to iTerm 2 a while ago, but would like to fix this small problem that I have with OS X's built-in Terminal.

Terminal is supposed to look like this when it first opens on my machine:

Good Terminal

However, I am frequently met with the following output:

Top line

And more infrequently (but still reproducible enough):


My .bash_profile file consists of a bunch of aliases and one defined function for calculating battery life from the shell. I am able to reproduce the issue with no .bash_profile at all. .bashrc is empty.

What is the cause of this issue, and how can I fix it?

  • Did you try disabling your .bash_profile ? – Lee Joramo Jun 30 '14 at 20:23
  • I am still able to reproduce the issue with an empty .bash_profile (renamed the original .bash_profile.bak). I edited that information in. – aglasser Jun 30 '14 at 20:24
  • Try using a Default terminal profile. Terminal.app -> Preferences -> Settings. Select a setting and using the "Gear" menu at the bottom of the list select "Restore Defaults". You can also looking the the 'Startup' section of preferences for anything unusual. – Lee Joramo Jun 30 '14 at 20:32
  • 1) "I am able to reproduce the issue with no .bash_profile at all." Have you completely quit terminal and restarted it to confirm? Changes wouldn't take effect if not. 2) Attempt to reset the default settings under Terminal > Settings > click the "Gear Wheel" > Restore Defaults. – njboot Jun 30 '14 at 20:33
  • @njboot this only happens when I quit Terminal completely (cmd+Q) and relaunch it. So yes, I have been completely quit the application beforehand. I have reproduced this using the default "Basic" theme after selecting "Restore Defaults" from the cogwheel. – aglasser Jun 30 '14 at 20:34

I would like to answer my own question, even though it is not an "answer," per se.

After testing on several different machines, I am confident that this is a bug with Terminal (and perhaps other virtual terminals on other operating systems). I have tested this on the following machines that are owned by separate users:

  • MacBook Pro (2012, 13-inch) running 10.9.4
  • MacBook Air (2012) running 10.9.3
  • MacBook Pro (2012, 15-inch) running 10.9.4

If someone would like to add to my list, please try running Terminal and quitting it in succession until you see the timestamp located on the same line as the initial prompt.

A friend of mine claims to have seen this on Linux as well.


Bash is doing this. It's sending a command to the terminal to move the cursor to the first line. It only does this occasionally, and I have not been able to figure out why yet, but I suspect it may depend on when bash receives and processes the first SIGWINCH signal, which informs it of the terminal size. It may be that if it receives SIGWINCH at a different time, it thinks the terminal has resized and it needs to move the cursor up.

[Bash version 3.2.57 on OS X.]

You must log in to answer this question.

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