5 Sep 14:45
trap signal with functional scope?
From: Sebastian Stark <seb-zsh <at> biskalar.de>
Subject: trap signal with functional scope?
Newsgroups: gmane.comp.shells.zsh.devel
Date: 2008-09-05 12:49:07 GMT
Expires: This article expires on 2008-09-19
Subject: trap signal with functional scope?
Newsgroups: gmane.comp.shells.zsh.devel
Date: 2008-09-05 12:49:07 GMT
Expires: This article expires on 2008-09-19
I have the following zsh function:
ssh () {
set_screen_title ${*##-*}
command ssh "$@"
set_screen_title "${HOST/.*}"
}
It sets my screens title to the first ssh argument not prefixed by
"-" (usually the remote hostname), executes the ssh command and then
changes screens title back to my local hostname.
(set_screen_title is defined as:
set_screen_title () {
print -nb "\ek${1}\e\\"
}
but this should not be relevant for this discussion)
Most of the time this just works and is cool. It fails when I send
ctrl-c to the ssh process. The function has no chance to execute the
second set_screen_title command.
At the moment I see two and a half solutions to this problem:
1) Always call set_screen_title in a precmd_ function. Kind of last
resort because it raises other problems.
(Continue reading)
RSS Feed