Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: trap signal with functional scope?
- X-seq: zsh-users 13191
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: trap signal with functional scope?
- Date: Fri, 05 Sep 2008 08:08:04 -0700
- In-reply-to: <200809051308.m85D8av1005006@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <DF6DC551-8F38-4015-AA18-755B59DEA01F@xxxxxxxxxxx> <200809051308.m85D8av1005006@xxxxxxxxxxxxxx>
On Sep 5, 2:08pm, Peter Stephenson wrote:
} Subject: Re: trap signal with functional scope?
}
} Sebastian Stark wrote:
} >
} > ssh () {
} > set_screen_title ${*##-*}
} > command ssh "$@"
} > set_screen_title "${HOST/.*}"
} > }
} >
} > Most of the time this just works and is cool. It fails when I send
} > ctrl-c to the ssh process.
}
} Without a suitably recent version of zsh, the answer is probably to
} upgrade.
Isn't this what "setopt localtraps" is for?
ssh () {
setopt localtraps
trap ':' INT
set_screen_title ${*##-*}
command ssh "$@"
set_screen_title "${HOST/.*}"
}
If your zsh isn't recent enough to have localtraps, see above.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author