added terminal title

This commit is contained in:
Steffen Vogel 2014-06-24 14:34:08 +02:00
parent 2b76510681
commit 57b4dd34e6

View file

@ -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