-1

Possible Duplicate:
Set the title of the terminal window to the current directory

I have many open Terminal shell windows open in Mac OSX.. Just right click on the icon for terminal and choosing one is not easy, because they all have the same title.

Is there a way to change the title of a terminal window so it would always be the current directory the shell is running from?

Thanks.

1 Answers1

0

Try this: Mac OS X Change the Terminal Window Title

The title of the Mac OS X terminal window can easily be changed. Changing the title can be useful when running a script or when using multiple terminal windows for different purposes in order to identify them easily when switching between applications and windows.

In the terminal window, from a bash prompt (the default shell) or in a bash shell script, use the following command to change the terminal window title to Tech-Recipes rules:

echo -n -e "\033]0;Tech-Recipes rules\007"

You can place (just about) any text in place of “Tech-Recipes rules” including the contents of a variable. Consider the following example:

name=`hostname` echo -n -e "\033]0;$name\007"

This will change the title of the terminal to the hostname of the computer running the shell.

Diogo
  • 30,792
nwgray
  • 61