10.4: Hide Terminal's window during launch at login

May 23, '05 10:39:00AM

Contributed by: victory

Tiger only hintGranted, this may be somewhat of an idiot tip, but if you're like me in that you consider the Terminal to be one of your top five apps that you use on a daily basis, you might understand why a slight change made in Tiger bothers me a bit.

Since I use it so frequently, I usually have the Terminal.app launched automatically as a login item (Preferences -> Accounts -> Login Items). Prior to 10.4, when adding this app to the Login Items list (where it was called Startup Items), I could select the 'Hide' checkbox and have the Terminal.app launch quietly in the background without opening a new window. I don't know if the change was deliberate, but as of 10.4, the 'Hide' checkbox has no effect -- Terminal launches and opens a new window regardless of what is chosen. BTW, prior to 10.3, there used to be a preference setting in Terminal called 'When Terminal Starts:' and a radio button that offered the choice 'Do nothing.' It isn't in 10.3 nor 10.4.

Anyway, whether or not this this was an oversight or a planned change, I came up with a rather crufty way to duplicating Terminal's old behavior. Create a terminal script (a .term file) whose only purpose is to execute an exit command -- in other words, to close the terminal window as soon as it opens. Then tell Terminal's preferences to run this script when it first launches. Thus when the Terminal.app starts, it will open and kill the first Terminal window. All following windows will open normally (e.g. Command-N or clicking on the Dock icon).

  1. Within Terminal, select File -> Save As... In the Save dialog, specify:
  2. Save the file to a safe location (I use ~/Library/Application Support/Terminal)
  3. Open Terminal's preferences and verify that 'Open a saved .term file when Terminal starts:' is now checked and pointing to the .term file you just created (based on the previous step, Terminal should have done this automatically for you)
Now test the settings by quitting the Terminal.app and relaunching it. The very first terminal window should open automatically and close an instant later. All subsequent behavior should be normal. Go ahead and add Terminal.app to your account's Login Items, assuming you followed this tip for that very reason.

Comments (8)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050512095145996