All the Pages | Luminosity | Mike & Sheryl | Little Sweden, USA | Midsummer' s Day | Glowrocks

« OK, I'm impressed! | Main | Creative Commons Chinese Photo Contest »

October 30, 2007

Specify Tab Names in Terminal

I have about a half dozen hosts that I ssh to on a regular basis. I often end up with multiple tabs, and it's very helpful if the tab label indicates what machine I'm connected to. Using iTerm's bookmarks, this works as desired with the bookmark name showing up as the tab name.

It took me a while, but I figured out a way to achieve the same result using the updated terminal program that ships with Leopard. With the new terminal it's straight-forward to save connections that automatically ssh to the desired host, and also display the remote system's name as the window title. Unfortunately, there's no obvious way to override the tab label, which displays the shell name.

My solution is kind of crude, but it does work. Simply create a hard link to the ssh binary with the name of each remote system you need to connect to (symbolic links don't work; ssh is still displayed). Then, while running terminal, copy one of the existing terminal templates and modify it as you normally would to change colors, etc. After that, in the shell settings tab, substitute the remote-name link you've previously created for "ssh." An example makes this more clear:

instead of "ssh -l username remote-name" specify "remote-name -l username remote-name" and voila', the remote system name is now displayed in the tab label.

Here's the command to create the links as needed:

sudo ln /usr/bin/ssh /usr/bin/remote-name

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Flickr Zeitgeist


California Coastline

  Click for larger version.
random image of CA Coast

Today in History

Leon Trotsky assassinated, 1940

Moon Phase

current moon phase

Validate Page

License

Creative Commons License
All the Pages is licensed under a Creative Commons License.

About All the Pages