Skip to content

Instantly share code, notes, and snippets.

@earthmeLon
Created October 8, 2012 20:11
Show Gist options
  • Save earthmeLon/3854658 to your computer and use it in GitHub Desktop.
Save earthmeLon/3854658 to your computer and use it in GitHub Desktop.
.bashrc - Set terminal title
#Add this to ~/.bashrc
#Set current terminal's title
function settitle()
{
if [ $# -eq 0 ]
then
eval set -- "\\u@\\h: \\w"
fi
case $TERM in
xterm*) local title="\[\033]0;$@\007\]";;
*) local title=''
esac
local prompt=$(echo "$PS1" | sed -e 's/\\\[\\033\]0;.*\\007\\\]//')
PS1="${title}${prompt}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment