Manage & Resume Multiple Terminals Easier with Window Groups in OS X

Saved and restored Terminal window group with commands

Do you have your terminal windows arranged in a particular way, perhaps running particular processes, that you want to consistently resume to without having to rearrange and relaunch things? Rather than relying entirely on the OS X Resume feature, you should use the Terminal app “Window Groups” tool, which lets you save not only the placement of groups of terminal windows, but also their commands and processes. These can be quickly resumed to at any time, making it simple to manage specific window configurations and workflows for specific command line tasks. This feature has been around in Terminal app on the Mac for quite some time, but it goes largely ignored even by the most advanced command line users. Fortunately, it’s extremely simple to configure and to use, and once you get accustomed to it, you’ll wonder how you ever functioned in Terminal without it.

Save their precise placement in a “window group” and you’ll be able to quickly resume productivity, right where you left off:

Saving a Group of Terminal Windows Placement & Commands

Got a set of terminal windows and commands that you use frequently? Save it as a group:

Organize Terminal windows on screen as desired
Optionally; run desired commands for each terminal window that you want to resume to
When finished, pull down the “Window” menu and choose “Save Windows as Group”

Save terminal windows placement as a group

Name the window group, and check the box for “Restore all commands”

Save terminal window group with commands

If this is going to be a frequently used placement of windows and commands, you may want to check “Use window group when Terminal starts” as well, which sets a Terminal app specific restore functionality upon each launch, going beyond the default restoration and resume functions of OS X.

Restoring Terminal Window Groups

Ready to restore to a specific terminal group?

Back in Terminal app, pull down the “Window” menu and go to “Open Window Group”
Select the choice you want to quickly resume to

Resume and restore terminal window groups in OS X

That’s all there is to it. Assuming you used the “Restore all commands” preference option, everything will be pretty much where you left off. If you’re going to use Terminal Window Groups for reconnecting to remote servers, be sure you have SSH keys configured so that the connection becomes automatic without having to enter passwords and login details, otherwise you’ll need to continuously authenticate with each resume of a window group that has remote sessions.

Saved and restored Terminal window group with commands

Get specific with this and you can have a terminal window group defined for completely different tasks, or for different times of day. For example, you may have a routine group of windows used for a specific set of tasks with a particular placement and set of commands running, like a large lynx browser on half the screen, with nettop monitoring network traffic in one corner with an active SSH connection to a remote server – save that as a window group and you can instantly resume not only the placement, but also those commands themselves, anytime, just by selecting that saved window group.

Another great perk to terminal.app specific Window Groups? They work even if you have the system-wide Window Restore feature turned off in OS X. Give them a try, you’ll be more productive.