Set the title on bash terminals

bottom-img
I often get lost among terminals in OS X. I forget which is which, or I have trouble resuming a session the next day after a break. To reduce this ‘contextual overhead’, it is nice to name terminals.

Put this in ~/.bash_profile:
function settitle() { echo -n -e "\033]0;$1\007"; }
export -f settitle
Now to set the title of the current terminal:
settitle 'Apache Pig'
And wallah:


High fives to this and this.