Terminal title in OS X

I did not come up with this. A quick google search turns up multiple ideas. I combined a few and trimmed things down to how I wanted the title to look. Here's my final result:

case $TERM in
  (xterm*)
  export PROMPT_COMMAND='echo -ne "\033]0;${USER}@$(hostname -s)\007"'
  ;;
esac

I added that code to ~/.bash_profile. Now my Terminal title changes when I open a Terminal or ssh into a machine then exit back to my Mac.

Comments

Popular posts from this blog

Database, schema, and table sizes in Greenplum

Greenplum update with multiple tables

Show running queries on Postgresql/Greenplum