Mac OS X - Terminal - ExecutionString

Using the menu option File -> Use Settings As Defaults of the Terminal program included with Mac OS X will do as it says and saves default color, window size etc. but also execute the command you have active at that moment. Everytime you start up Terminal or launch a New Shell.

In my case I had an SSH session active when I thought to lock it to a certain window size by default. And from then on, Terminal tried to make an SSH connection everytime a new shell was opened or Terminal was started. Looking through all the options of Terminal -> Preferences or Terminal -> Window Settings... didn't show any place where SSH was started.

With a few searches via Google I stumbled upon MacNN Forums where a fix was provided for this issue.

The solution:

Start Terminal, and cancel what ever Terminal automatically runs with Ctrl-c so that you're back in the standard shell. Then copy the appropriate line below and paste it into the Terminal window and press the Enter key.

Stop Terminal from running a command at startup:

defaults write ExecutionString ""

Remove all default settings and return Terminal to it's original state:

rm ~/Library/Preferences/