diff --git a/.bash_prompt b/.bash_prompt index e3cb46e..fa69bfe 100644 --- a/.bash_prompt +++ b/.bash_prompt @@ -25,6 +25,14 @@ function show_prompt { pre+='\[\e[31m\]✘ ' fi + case "$TERM" in + xterm*|rxvt*) + echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007" + ;; + *) + ;; + esac + # Test if root if [[ $EUID -ne 0 ]]; then pre+='\[\e[01;34m\]\u\[\e[01;33m\]@\[\e[01;36m\]\H' @@ -38,12 +46,3 @@ function show_prompt { __git_ps1 "$pre " "$post" '\[\e[01;30m\](%s\[\e[01;30m\]) ' } - -# If this is an xterm set the title to user@host:dir -case "$TERM" in -xterm*|rxvt*) - PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" - ;; -*) - ;; -esac