Set the title for a Tab in iTerm2 from the Unix command line
Shell
Switch branches/tags
Nothing to show
Latest commit ff3f4ec Jun 8, 2012 @craic README formatting
Permalink
Failed to load latest commit information.
README
iterm_title

README

iterm_title is a bash shell script that sets the Name for the current tab in iTerm2 (http://www.iterm2.com) on Mac OS X

It uses Applescript called from the UNIX command line

iTerm2 (http://www.iterm2.com) by George Nachman is an excellent terminal emulator for Mac OS X that is highly configurable. I it prefer over the system Terminal application.

This script lets you set the title for the current session (tab) from the UNIX command line in that session. This makes it much easier to identify the correct tabs when you have several of them open in a single terminal 

To Install, copy it to /usr/local/bin and 'chmod a+x iterm_title' to make it executable

To Run type the command followed by the title

$ iterm_title 'Your title'

You can have multiple words in the title and the quotes are optional, unless the title has internal quotes.

Note that the tab width does not expand to fit your text. About 25 characters is a reasonable maximum.

This script could be easily modified to change session colors, etc from the command line - take a look at the iTerm2 docs.

By default iTerm will show the current foreground process, such as bash, in the tab title. I find this distracting. You can prevent it by going to Preferences -> Appearance and unchecking 'Show current job name' in the 'Window and Tab Titles' section.

The script was written by Robert Jones (jones@craic.com) of Craic Computing LLC and is freely distributed under the terms of the MIT license.