Coloring Terminal's SSH server connections

Aug 23, '05 08:31:00AM

Contributed by: macventure

If you find yourself heading in and out of various remote servers (especially if done in the same Terminal window), then this AppleScript should be quite useful. I found a few other tips on this site about coloring Terminal windows, but none of them offered what I wanted: A single script which could be activated by a command key (via QuicKeys, iKey, Spark, etc.). The others seemed a bit too complex for such a simple task. A simple hostname and some sed parsing, and you're golden.

A couple of notes on the script (duplicated in the script's comments as well):

  1. You need to be inside a shell, not within an application (e.g. vi, emacs, pine...).
  2. The script parses the hostname using sed, so you'll need to make sure your prompt has an identifiable character within it.
Regarding the other hints linked above, some are for random coloring and others specific to ssh logins -- although I can't seem to get the .term files to open a new ssh connection when changing the ExecutionString entry in the term file. Maybe someone can add that trick to this post. Enjoy!

[robg adds: I haven't tested this one...]

Comments (5)


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