Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Hide Terminal's window during launch at login Apps
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:
    • Save as: StartupWindowClose (or some other meaningful filename)
    • Check 'Open this file when Terminal starts up'
    • Under 'When opening this file:' choose the 'Execute this command (specify complete path)' radio button
    • In the text field, enter exit
    • Check 'Execute command in a shell' (if it isn't already checked)
  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.
    •    
  • Currently 2.83 / 5
  You rated: 4 / 5 (6 votes cast)
 
[21,032 views]  

10.4: Hide Terminal's window during launch at login | 8 comments | Create New Account
Click here to return to the '10.4: Hide Terminal's window during launch at login' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Hide Terminal's window during launch at login
Authored by: barrysharp on May 23, '05 02:52:34PM

I'm not sure about your statement indicating that under 10.4 the Hide box being selected has no affect.

I have noticed that Terminal.app will not hide as you say, and I've found this to be annoying and thank you for the 'hint'.

However, I have several Apps launched at my login and they all hide with the one exception being Terminal.

...but now under 10.4.1 I now notice that my Mail.app login launch no longer hides itself along with Terminal - but all other do hide themselves. Very Strange and it appears the Hide box actions are either random and certainly aren't deterministic for me.

---
Regards... Barry Sharp



[ Reply to This | # ]
10.4: Hide Terminal's window during launch at login
Authored by: schlepping on May 23, '05 05:57:07PM

Isn't just as easy to click on the Terminal icon in the dock or download an app and use a hotkey to open terminal?



[ Reply to This | # ]
10.4: Hide Terminal's window during launch at login
Authored by: victory on May 23, '05 07:18:07PM

Yah. As I mentioned in the opening paragraph of the hint, having the Terminal.app 'pre-launched' at startup (to save those 2-3 seconds later) may not be like a big deal to most. However, if you use the Terminal as part of your daily work, it's just one of a myriad of (seemingly insignificant) details that makes the overall environment a bit more pleasant to work with. (Which for me, kinda embodies the entire reason I prefer OSX as my computing platform in the first place)



[ Reply to This | # ]
10.4: Hide Terminal's window during launch at login
Authored by: mclbruce on May 24, '05 12:24:56AM

I don't use terminal much, but I wonder if using the created .term file as the login item would work? That might make step three unnecessary.



[ Reply to This | # ]
10.4: Hide Terminal's window during launch at login
Authored by: trosberg on May 25, '05 02:52:21PM
I suppose the same functionality is accomplished with a saved AppleScript as a Login item:
tell application "Terminal"
	launch
	set w to first window
	set visible of w to 0
end tell


[ Reply to This | # ]
10.4: Hide Terminal's window during launch at login
Authored by: Mark Barton on Jun 08, '05 08:54:29PM
To get slightly closer to the original behaviour, I created the following command file (my shell is tcsh),

~/Library/Application\ Support/Terminal/hideterminal
with the three lines

set backslash_quote = "yes"
osascript -e "tell application \"System Events\" to set visible of some item of\
 ( get processes whose name = \"Terminal\" ) to false"
clear
and used that for the "Execute this command (specify complete path)" option in the .term file. Naturally the command file needs its execution bit set:

chmod +x ~/Library/Application\ Support/Terminal/hideterminal


[ Reply to This | # ]
10.4: Hide Terminal's window during launch at login
Authored by: jiversen on Nov 08, '06 07:36:38PM
Great hint. One problem I'm finding with the solutions is that the original window present when terminal opens is actually closed, not hidden.

This simple script replicates the original true 'hide' behavior as far as I can tell, and actually hides the application, leaving the window intact. (Why do I care?--the first window opened by terminal is right where I want it. Later ones open somewhere else on screen.)

tell application "Terminal"
	launch
end tell

tell application "Finder"
	set visible of application process "Terminal" to false
end tell


[ Reply to This | # ]
10.4: Hide Terminal's window during launch at login
Authored by: figgles on Oct 29, '07 07:15:32AM

This is a handy tip for people running Visor who want to close the automatically opening window on startup. This is better than setting the visibility of the window to 'false'.



[ Reply to This | # ]