Friday
30Oct2009
Simple bash script to name a tab in iTerm
Friday, October 30, 2009 at 1:26PM
I like to open a lot of tabs in iTerm, the open source replacement for Apple's Terminal.app on the Mac. Unfortunately, its easy to forget which is which, as typically they don't get very descriptive names.
In particular, I have a few scripts I run which will automatically ssh into a remote server, and run screen. When I wanted to find one of these, I'd often have to click several tabs to see which one I wanted (since they would all, rather unhelpfully, be called "ssh").
So I wrote a simple script, which I call "nametab", which allows you to name the tab you are in from the command line. You just type something like:
$ nametab New tab nameIf you'd like to use this yourself, here is the code: Just put it in a file in your PATH, and ensure that it is executable (ie. do a
chmod u+x nametab).
Ian Clarke |
1 Comment | 

Reader Comments (1)
You might also take a look at:
screen_ssh
You could specify the command executed when you ssh in to a specific host, or all hosts. Something like (see line with LocalCommand):
[drowe@drowe][H:9448][J:0]> more config
HOST *
PermitLocalCommand yes
LocalCommand /home/drowe/.ssh/screen_ssh.sh $PPID %n
ServerAliveInterval 240
But, you might have already known this. :)