I have a window group saved with 3 terminals set up how I like them and I have a shortcut to that opens this window group on my desktop. Now I want to add a startup command (possibly different commands for each window) when each terminal is opened, but I do not want to set a default command for every terminal i start like i know you can. What would be the easiest way to do this?
So you already have a separate setting for each terminal? You need to edit each of those settings to specify the command to run.
When open a terminal from these setting (either individually or as part of a Window Group), it will run the command that you specified in the Settings' startup commands. You can open Window Groups from the
As of Mac OS X Lion 10.7, you can do this without creating separate settings profiles for each terminal. If you create a terminal with Shell > New Command…, Terminal can remember the command when you save it in a window group. When you open a group, any saved commands are run in the corresponding terminal(s).
When saving a window group, Terminal will automatically save "safe" commands†, and you can save all commands by selecting the Restore all commands checkbox.
† "Safe" commands are commands that are reasonable to run without user confirmation, and are automatically restored when Terminal is Resumed. They are also automatically saved in Window Groups. "Safe" commands include any command issued via New Remote Connection, everything listed in
This list can be customized with the defaults(1) command (
For example, to automatically allow emacs with arguments:
For convenience, once you've created the preference setting you can add additional items with
@Matt G's answer is good, but an alternative would be to use the open-source iTerm, which has a Bookmarks feature that makes this much easier than having to set up a different terminal profile for each. Since I started using it instead of Terminal.app I haven't looked back. Worth checking out...