Skip to content

Set the title for a Tab in iTerm2 from the Unix command line

Notifications You must be signed in to change notification settings

craic/iterm_title

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

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 ([email protected]) of Craic Computing LLC and is freely distributed under the terms of the MIT license.

About

Set the title for a Tab in iTerm2 from the Unix command line

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages