Creating colored SSH sessions in Terminal

Jul 02, '03 10:53:00AM

Contributed by: winstonford

After looking around for a way to alias custom-styled SSH sessions and running into trouble with iTerm and xterm, I arrived at the following method:

  1. Open Terminal.app and use Command-I to select font face, color, size, background color, and choose a title, all of which you associate with the box being SSH'd into, and then save it as a test.term file in your home dir.

  2. Open the test.term file, preferably in BBEdit using a bb alias, and search for ExecutionString. Between the string tags in the line beneath it, add the following SSH info, replacing the "yourusername" and "yourtestserver.whatever" with the info specific to your server:

    ssh yourusername@yourtestserver.whatever; exit

  3. Open your .cshrc or preferred shell rc file in the home dir and add the following single line (shown on two for spacing; replace the return with a single space) without quotes:

    alias test open -a
    /Applications/Utilities/Terminal.app ~/test.term


  4. In Terminal, type source .cshrc and hit Enter to reload the rc file.

  5. Now type test and hit Enter; you should see a new window with test settings. it should be prompting you to login.
I've created .terms for a number of boxes. Here are a couple:

Indigo Imac -- Be sure to change the ExecutionString info from step two.
Bronze PowerBook -- As this is my local machine, it doesn't have the ExecutionString and is saved as my com.apple.Terminal.plist file in the Preferences dir for default.

If you have trouble, try using one of the above .term files. Nice how OS X uses the same XML format for both the .term files and the .plist preferences file.

[robg adds: Another method was covered in this hint, and a couple of other hints (1, 2) that dealt with the "ExectionString" edits.]

Comments (2)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030625043920144