screen: Bugfixes

Multiple bugfixes in this patch:
1) Do not evaluate $TITLE.
2) Do not let normal title code set screen session titles if screen
plugin is active
3) Use default way to set hardstatus in screen, not xterm compatible
string.

Signed-off-by: Markus Pargmann <mpargmann@allfex.org>
This commit is contained in:
Markus Pargmann 2012-12-13 23:16:25 +01:00
commit 229ef8cfdc
2 changed files with 18 additions and 7 deletions

View file

@ -2,12 +2,23 @@
#http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
#Fully support screen, iterm, and probably most modern xterm and rxvt
#Limited support for Apple Terminal (Terminal can't set window or tab separately)
ZSH_SCREEN_PLUGIN_ACTIVE=false
for i in $plugins; do
if [[ "$i" == "screen" ]]; then
ZSH_SCREEN_PLUGIN_ACTIVE=true
fi
done
function title {
if [[ "$DISABLE_AUTO_TITLE" == "true" ]] || [[ "$EMACS" == *term* ]]; then
return
fi
if [[ "$TERM" == screen* ]]; then
print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
# do not set the screen hardstatus, if screen plugin is active
if [[ "$ZSH_SCREEN_PLUGIN_ACTIVE" != "true" ]]; then
print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
fi
elif [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then
print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then