Window Title in Bash
Here is a nice function to do it:
# Allow the user to set the title.
function title {
PROMPT_COMMAND="echo -ne \"\033]0;$1 (on $HOSTNAME)\007\""
}
Put that in your ~/.bashrc, then type "title whatever" to set the title. If you want to get rid of the hostname, remove "(on $HOSTNAME)".
Edit: make sure to . ~/.bashrc
(aka source ~/.bashrc
) before trying, of course.
Source link.