Avoid competing Terminal window title commands

Nov 16, '03 11:18:00AM

Contributed by: Anonymous

Note to self: if you're trying to set a terminal's name via File -> Set Title..., then by all means, please be sure that your /etc/bashrc file does NOT contain code similar to the following:


PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}:${PWD}\007"'
If the code is present, then with certainty, the next time you launch the Terminal, that code will override the setting made using the Terminal app itself and equally certain, hours will be lost, heads will be scratched, and much frustration will ensue as you try to figure out what's going on.

On the other hand, don't underestimate the power of this technique; if you would like dynamic terminal titles based on the current working directory or remote host, they can be easily configured.

Comments (3)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20031109144550227