macdevcenter.com
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button

Cloning Terminal to Ease Window Management

by Rich Morin
06/01/2006

With three screens up 24/7, it's easy for me to accumulate windows. I typically have several dozen available on my Mac, spread across a few dozen apps. In general, this is quite convenient. When I'm not using an app, I hide it (via cmd-H) and all of its windows disappear. If I want to get only a few windows out of the way, I WindowShade them or send them to the Dock.

Unfortunately, these approaches don't work very well for applications that have lots of windows. Terminal programs, for example, may have dozens of windows, each presenting a different shell and/or application context. Mac OS X doesn't let me hide some of an app's windows, so that's out. The Dock and WindowShade are awkward ways to manage dozens of windows; simply dismissing and retrieving a set of several windows becomes quite a hassle.

Fortunately, there is a (relatively) simple workaround. By using multiple copies of an app (e.g., Terminal), I can hide and display each copy's windows separately. I currently have four copies of Terminal available. One is used for generic tasks, two are used for specific projects, and one is idle.

This arrangement is working well. Any new Terminal window I create (via cmd-N) becomes part of the current copy's set. I even found a way to let a script know which Terminal it's running under. Finally, although it might be nice to have the ability to migrate windows between sets, this has not been a serious deficiency in practice.

How to Do It

Here's a basic walk-through of the procedure. Feel free to season to taste; after all, it's your machine! However, if you're a bit paranoid, you may want to quit the relevant copies of Terminal before performing these steps.

  1. Copy the preference file and the Terminal app.

    Using the Finder, go to ~/Library/Preferences and copy com.apple.Terminal.plist to com.apple.Terminal_2.plist. Then, go to /Applications/Utilities and copy Terminal.app to Terminal_2.app.

  2. Link up the app to the preference file.

    Control-click on Terminal_2.app and select "Show Package Contents." In the Contents folder, double-click on the Info.plist file. In the resulting Property List Editor, change CFBundleIdentifier from com.apple.Terminal to com.apple.Terminal_2 (see Figure 1). Save and Quit to make the changes permanent.

  3. Trim the foreign language support files (optional).

    In the Resources folder, remove any superfluous *.lproj files. This can reduce the copy's disk storage by more than 60 percent.

figure 1
Figure 1. Making changes in Property List Editor.

You can now start up and play with the copied app. Some customization is also reasonable at this point. The following sections explain how to change the windows' titles, the app's name in the Menu Bar, and the value of the TERM_PROGRAM environment variable. The techniques become increasingly scary as we go along; feel free to bail out at any time.

Running Mac OS X Tiger

Related Reading

Running Mac OS X Tiger
A No-Compromise Power User's Guide to the Mac
By Jason Deraleau, James Duncan Davidson

Pages: 1, 2

Next Pagearrow