added terminal title
This commit is contained in:
parent
2b76510681
commit
57b4dd34e6
1 changed files with 8 additions and 9 deletions
17
.bash_prompt
17
.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
|
||||
|
|
Loading…
Add table
Reference in a new issue