Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Titlebar-handling with zsh and screen
- X-seq: zsh-users 4749
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: Clint Adams <clint@xxxxxxx>
- Subject: Re: Titlebar-handling with zsh and screen
- Date: Sun, 10 Mar 2002 02:38:23 +0100
- Cc: Juhapekka Tolvanen <juhtolv@xxxxxxxxx>, zsh-users@xxxxxxxxxx, Sven Guckes <guckes@xxxxxxxxxxxxxxxxx>, jw@xxxxxxxxx, ric@xxxxxxxxxxxxxxxxxxxx
- In-reply-to: <20020309051805.GA29385@xxxxxxxx>
- Mail-followup-to: Clint Adams <clint@xxxxxxx>, Juhapekka Tolvanen <juhtolv@xxxxxxxxx>, zsh-users@xxxxxxxxxx, Sven Guckes <guckes@xxxxxxxxxxxxxxxxx>, jw@xxxxxxxxx, ric@xxxxxxxxxxxxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20020309051250.A30021@xxxxxxxxxxxxxxx> <20020309051217.GA22866@xxxxxxxxxxxxxx> <20020309051805.GA29385@xxxxxxxx>
BTW, for those who are interested, here's my current code for the
terminal title:
In .screenrc:
hardstatus off
hardstatus string "%h%n (%t)"
termcapinfo xterm*|rxvt hs:ts=\E]2;:fs=^G:ds=\E]2;TITLEDISABLED^G
In .zshrc:
zmodload -i zsh/parameter
precmd()
{
psvar[1]=$#jobstates;
if [[ $psvar[1] -eq 0 ]] then
psvar[1]=()
elif [[ $psvar[1] -eq 1 ]] then
psvar[1]="$psvar[1] job"
else
psvar[1]="$psvar[1] jobs"
fi
[[ -n $TTY && $TERM == (xterm*|dtterm|rxvt|screen*) ]] &&
{
print -nP "\e]1;%m:%.\x07"
print -nP "\e]2;%(1v. %1v |.)${WINTITLE:+ $WINTITLE |} %n@%m - %~ | %y"
[[ $TERM == screen* ]] && print -n .
print -n "\x07"
} > $TTY
}
TRAPCLD() { [[ -o interactive && -n $TTY ]] && precmd }
However, there's still a problem when a job terminates at the wrong
place. For instance:
$ sleep 5 &
$ screen
When the sleep terminates, the title will be (incorrectly) updated.
Moreover, I don't understand why the title doesn't come back to its
correct value when I hit the Return key.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/> - 100%
validated (X)HTML - Acorn Risc PC, Yellow Pig 17, Championnat International
des Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
Messages sorted by:
Reverse Date,
Date,
Thread,
Author