Aug 02, '05 08:29:00AM • Contributed by: jdsmith
To solve this, I wrote a modified script (4KB binary download -- it's binary to maintain the BEL and Escape characters encoded in the script) that first sets a unique window title, and then selects the appropriate window based on that title. With one script, you can manage as many different SSH host/color combinations you'd like. Simply add custom colors to the case statement where indicated, and link to the script using the name of the new host you'd like. Example:
% cd bin
% ln -s ssh_host foobar
% rehash ## for tcsh shell [or]
% hash -r ## for bash shell
% foobar
To keep host names short, you can either add an /etc/hosts alias, or link with the full hostname (e.g. ln -s ssh_host foobar.baz.com) and create a shell alias for it. If you set your own window title with a precmd alias or equivalent, you might want to remove the last echo (which clears the title).
