Mac Terminal Tip

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 "33]0;${USER}@${HOSTNAME}:${PWD}07"'

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.

Bonus tip: Stop the screen from being cleared after running commands such as vi or man by setting the term type to VT100. More details and a discussion are available in this MacOSXHints article.