Permalink
Browse files

title: made title work again in screen

  • Loading branch information...
1 parent f72e778 commit 2c04013270b95e3b12bfe74c351ceeeac3df0e33 @avuserow avuserow committed Mar 8, 2009
Showing with 18 additions and 6 deletions.
  1. +5 −1 bash/title_prompt
  2. +5 −1 ksh/title_prompt
  3. +8 −4 zsh/title
View
@@ -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
@@ -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
@@ -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
}

0 comments on commit 2c04013

Please sign in to comment.