clean up titles and prompts

This commit is contained in:
David Alexander Majnemer 2009-01-20 22:24:52 -06:00
parent acf4c6e796
commit 23d4b7898c
3 changed files with 8 additions and 9 deletions

View file

@ -14,10 +14,10 @@ function do_prompt ()
local TITLEBAR
case $TERM in
xterm*|*rxvt*|cygwin|interix|Eterm|mlterm|kterm|aterm|putty*)
TITLEBAR='\[\033]0;\u@\h:\w\007\]'
TITLEBAR='\[\033]1;\u@\h:\w\007\033]2;\u@\h:\w\007\]'
;;
screen*)
TITLEBAR='\[\033k\033\134\033k\u@\h:\w\033\134\]'
TITLEBAR='\[\033k\u@\h:\w\033\134\]'
;;
*)
TITLEBAR=''

View file

@ -10,10 +10,10 @@ fi
case $TERM in
xterm*|*rxvt*|cygwin|interix|Eterm|mlterm|kterm|aterm|putty*)
TITLE=']0;${USER}:${PWD}'
TITLE=']1;${USER}:${PWD}]2;${USER}:${PWD}'
;;
screen*)
TITLE='k\\k${USER}:${PWD}\\'
TITLE='k${USER}:${PWD}\\'
;;
*)
TITLE=''

View file

@ -56,15 +56,14 @@ function title
{
case $TERM in
screen*)
# Use these two for GNU Screen:
print -nR $'\ek'$1$'\e'"\\"
shift
print -nR $'\e_screen \005 | '$*$'\e'"\\"
# Use this for GNU Screen:
print -nR $'\ek'$2$'\e'"\\"
;;
xterm*|*rxvt*|cygwin|interix|Eterm|mlterm|kterm|aterm|putty*)
# Use this one instead for everybody else:
shift
print -nR $'\e]0;'$@$'\a'
print -nR $'\e]1;'$@$'\a'
print -nR $'\e]2;'$@$'\a'
;;
esac
}