Different Terminal windows in different Spaces desktops

Hippo Man

Hippo Man
I have several kinds of Terminal windows that I regularly use (user shell, root shell, remote shell, etc.), and I want to force them to appear in certain Spaces desktops. I can force all Terminal windows to appear in a specific Spaces desktop, but I'd like to have some Terminal windows always appear in one Spaces deskop, and other Terminal windows always appear in another Spaces desktop. Furthermore, I'd like other types of Terminal windows to not be forced to appear in any particular Spaces desktop.

Is this possible? If so, how do I configure Spaces or the Terminal windows so that I can realize this goal?

Thank you very much in advance.
.​
 
Thinking about this, I don't believe it's possible.

Mac OS X is a document-centric operating system, meaning that you launch a program then work with documents that "belong" to that program. It's different from Windows, where each document is basically a separate instance of the application itself.

I don't see any way of Spaces nor Mac OS X to tell the difference between one document and the next, and, as it currently stands, you only have control over what application launches in a certain Space, not what document launches in a certain Space.
 
Thanks.

So do you think it's possible for me to define copies (or near-copies) of the Terminal program that look like different applications?

I tried the following approaches, but they didn't work:

1. I went into /Applications/Utilities and did this: ln -s Terminal.app Terminal-Test.app. I then tried to specify that the Terminal-Test application starts up in a unique Spaces desktop. However, Spaces couldn't tell the difference between Terminal and Terminal-Test.

2. I went into /Applications/Utilities and did this: cp -rp Terminal.app Terminal-Test.app. I then used a recursive "mass change" utility to change all occurrences of the string "Terminal" to "Terminal-Test" in all files within the Terminal-Test.app directory. Then, when selecting the Terminal-Test app within the Spaces preferences dialog, it indeed was seen as being separate from Terminal, but it went into the list as "unknown application".

Is there some other way to make a copy of Terminal.app so that the operating system thinks it's a completely separate program called (for example) Terminal-Test?

Thanks again.
.​
 
It figures that the symbolic link wouldn't work, because it's simply a link back to the original Terminal.app bundle.

As for copying the actual Terminal.app to another application bundle, I think we're on to something. I did the same thing you did (pretty much, I just duplicated the Terminal.app program in the Finder, though), and noticed that the permissions on the bundle were different from the original... specifically, the original application had an owner of "system," whereas the copy had an owner of "jhoppe" (me).

Can you try duplicating the Terminal.app again, but then make the permissions match the original?
 
Thanks for your continuing help with this.

The "cp -rp" and the mass change utility I use both preserve ownership and permissions. I double-checked.

However, I had to be a bit more selective with the mass change, so as not to change the names of the references to the help files or to the .icns or .sdef files. Also, I had to change the name of the Terminal program in the Contents/MacOS subdirectory to Terminal-Test

Once I did all this, I then saw two instances of Terminal.app in the Finder: one with the standard Terminal icon, and the other with a generic icon. In other words, my Terminal-Test.app still looks like Terminal.app to the operating system, even after all the mass changes. Furthermore, in the Spaces configuration, if I select this second Terminal.app instance, it gets treated as if I just clicked again on the original Terminal.app, which is essentially a no-op.

In other words, making a renamed copy of an application like this doesn't seem to work.

Is there some sort of canonical way to make a renamed copy of an application without rebuilding it?
.​
 
Is there some sort of canonical way to make a renamed copy of an application without rebuilding it?

Try this:

- Duplicate Terminal.app in the Finder.
- Control-click on the copy, and select Show Package Contents.
- Open the "Info.plist" file in a text editor.
- Search for the part that says:
Code:
	<key>CFBundleIdentifier</key>
	<string>com.apple.Terminal</string>
And change it to something like:
Code:
	<key>CFBundleIdentifier</key>
	<string>com.apple.Terminal-copy</string>
(Really you can change the string to something completely different if you want, and it might be a good idea not to tread in Apple's namespace. So if you want to make it something like org.yourname.terminal2, go right ahead.)
- Save changes, and launch your copy from the Finder.
- Drag the copy from the Finder into the Spaces preference pane. (Don't use the "+" button in the Spaces preferences. It's funky.)

One thing to be aware of is that when you change the bundle identifier, which seems to be necessary here, you also change the preferences. Your two copies of Terminal will use separate preferences files, so you may need to re-enter your custom settings. On the other hand, you might consider it a good thing that you can make the two more distinct.

I haven't tested it extensively, but it seems to work just as it should. See attached screenshot.
 

Attachments

  • Picture 2008-08-23 14-56-07.png
    Picture 2008-08-23 14-56-07.png
    14.6 KB · Views: 4
Back
Top