3

I use QuickSilver to launch OSX's terminal app and terminals for ssh'ing to outside servers. The "profiles" are saved as .term files in ~/, eg "term.term",server1.term, etc. This works well but it piles up copies in my Settings window: term 1, term 2, term 3 etc. as if I'm not clearing out something when I exit and creating a "duplicate" each time I subsequently launch. Can someone explain this and offer a solution?

1 Answer 1

1

.term files aren’t exactly meant to work like bookmarks, although they can be used that way. They’re primarily meant to be interchange files for sharing settings with others, or between machines, rather than copying the entire Terminal preferences file around and replacing it wholesale.

When you open one, Terminal looks to see if it contains settings that correspond to an existing settings profile; if it isn't identical to an existing one, it imports the settings stored in the .term file into a new profile, appending digits to the name to avoid collisions when there’s already a profile with that name.

Occasionally, the format for profiles changes in newer versions of Terminal. In that case, Terminal updates profiles stored in preferences to the latest format, but if you created .term files with an earlier version, it doesn't update the file on disk, so every time you open them the settings don't match an existing profile and it creates a new one. If this is your issue, you should be able to resolve it by opening a .term file and re-exporting it (using the action menu at the bottom of the profiles list, or by dragging it out of the list to Finder).

If you want to bookmark an ssh session, for example, you can just drag an ssh URL (of the form ssh://user@host/) to Finder and it will create a URL bookmark file. When you open it, Terminal will create a new terminal and issue an ssh command. By default, Terminal is the application that handles ssh:, ftp: and telnet: URLs (as well as x-man-page: for viewing man pages).

Another approach is to use Window Groups to save commands coupled with particular window layouts and settings. The simplest way to do this is to create ssh sessions (for example) with the Shell > New Remote Connection command, or Shell > New Command. When you do this, Terminal remembers the ssh command used to create the window. Then layout the windows as you like, change the settings profiles using the Inspector if you wish, and save all the current windows with Window > Save Windows as Group. In the save dialog, select “Restore all commands” to ensure that all the commands† are run the next time you open the window group.

Of course, you can also create window groups that only contain one window each, if you want to only open one connection at a time.

Each time you open a window group, it will recreate all the windows that were saved, and issue commands that were remembered. You can open a window group more than once—each time it creates another set of windows.

† By default, Terminal will only restore a few commands it considers “safe”, including shells and top, for example. Selecting the checkbox tells it that you want it to restore all recorded commands...so be careful.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .