I'm using Mac OS X Lion 10.7. I open Terminal and its window shows up but immediately close and its icon remains in the dock. It's working fine a moment ago. I don't know what i have messed. I looked at the log file in the Console application and see "login: USER_PROCESS 172 ttys000"

  • Does this happen if you create a new user and then use that? – Mark Apr 15 '13 at 10:01

This looks as if there is an issue with one of the configuration files for your shell. To fix do

  1. With Terminal still running, use Shift-Cmd-N to run zsh
  2. In zsh run ls -l .bashrc .profile and rename all files you found (mv .bashrc .bashrc.save, mv .profile .profile.save)
  3. With the window still open, type Cmd-T to open a new tab running bash.
  4. Assuming this worked, review .bashrc.save/.profile.save (and anything called from there) for errors. You can also rename them back and run login in the running shell which may show some errors from executing the scripts and give you some hints on where to look for problems.
  5. In case running bash in step 3 didn't work (tab closed again) you may also have to rename /etc/profile and /etc/bashrc with sudo mv /etc/profile /etc/profile.save; sudo mv /etc/bashrc /etc/bashrc.save

I recently had this issue because I uninstalled the version of bash installed by macports (/opt/local/bin/bash) not realizing it was my default shell. The solution was to change my default shell back to /bin/bash via the advanced user options in the Users & Groups System Preferences. (See @sdmeyers' comment on @Pyrolistical's answer for instructions.)


Try to hide the current ~/.bash_profile from your shell. Just rename it to ~/.bash_profile_bkp and see if something changes.


What shell are you using? Try flipping the default one. I found a bad .profile configuration crashed bash, and temporarily switching to another shell to edit the .profile fixed my issue.

  • Can you describe how the default shell can be changed? – nohillside Apr 15 '13 at 10:44
  • 2
    In the User & Groups System Preference, Right(Control)+Click on the user whose shell you want to change. This should present an "Advanced options..." option. Select it and it will bring up a pane allowing you to select a number of options including the Login shell. BTW, this option is really the only option I'd suggest ever changing. – sdmeyers Apr 15 '13 at 12:44

You must log in to answer this question.

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