cd ~/Developerthe window title is updated to:
jason@rocksteady:~/DeveloperWhile the Terminal app in OS X does allow you to customize the title to some extent by adding the TTY name, name of running process etc. I prefer the 'user@host:pwd' format.
After digging around in /etc/bashrc on CentOS 5, I found you can set the PROMPT_COMMAND Bash variable and have your title updated after every command.
Add the following to your .bash_profile in Mac OS X to get the same behaviour:
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007"'
Hey that's pretty neat. I've updated my terminal window on my mac to do the same.
ReplyDeleteThis post title is misleading. You should say "How t set the prompt" rather than window title. Also, you should use PS1 variable to set the prompt.
ReplyDelete