title: made title work again in screen

This commit is contained in:
Adrian Kreher 2009-03-07 20:47:51 -06:00
parent f72e778f26
commit 2c04013270
3 changed files with 18 additions and 6 deletions

View file

@ -14,7 +14,11 @@ function do_prompt ()
local TITLEBAR
case $TERM in
xterm*|*rxvt*|cygwin|interix|Eterm|mlterm|kterm|aterm|putty*)
TITLEBAR='\[\033]1;\u@\h:\w\007\033]2;\u@\h:\w\007\]'
if [ "${STY}" ] ; then
TITLEBAR='\[\033k\u@\h:\w\033\134\]'
else
TITLEBAR='\[\033]1;\u@\h:\w\007\033]2;\u@\h:\w\007\]'
fi
;;
screen*)
TITLEBAR='\[\033k\u@\h:\w\033\134\]'

View file

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

View file

@ -64,10 +64,14 @@ function title
print -nR $'\e]0;'$@$'\a'
;;
xterm*|*rxvt*|cygwin|Eterm|mlterm|kterm|aterm|putty*)
# Use this one instead for everybody else:
shift
print -nR $'\e]1;'$@$'\a'
print -nR $'\e]2;'$@$'\a'
if [ "${STY}" ] ; then
print -nR $'\ek'$2$'\e'"\\"
else
# Use this one instead for everybody else:
shift
print -nR $'\e]1;'$@$'\a'
print -nR $'\e]2;'$@$'\a'
fi
;;
esac
}