Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug with traps and exit
- X-seq: zsh-workers 45361
- From: Martijn Dekker <martijn@xxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Bug with traps and exit
- Date: Thu, 30 Jan 2020 15:01:23 +0100
- In-reply-to: <d950fdd8-9c44-b5a4-3b32-dee87dc443f4@inlv.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <C0CF1A8E-FD75-4024-BA4B-0C4D8880FB8D@dana.is> <3859b4bf-08ba-62d5-f00a-3ec4e67caf95@inlv.org> <d950fdd8-9c44-b5a4-3b32-dee87dc443f4@inlv.org>
Another variant.
Strangely, this one is not detected when tried from within a loop.
====begin test script====
test_BUG_TRAPFNEXI() {
{ test_result=$(
my_pid=$(zsh -c 'echo "$PPID"')
test_fn() {
kill -s ALRM "$my_pid"
print "stillhere"
}
trap "print 'trap'; exit" ALRM
test_fn
); }
if [[ ${test_result} == $'trap\nstillhere' ]]; then
print "bug found"
else
print "bug NOT found"
return 1
fi
}
test_BUG_TRAPFNEXI
while :; do
test_BUG_TRAPFNEXI
break
done
test_BUG_TRAPFNEXI
====end test script====
Output, as of zsh 5.1:
bug found
bug NOT found
bug found
The second line (the "NOT found" one) was when the bug test was tried
within a dummy loop.
- Martijn
--
modernish -- harness the shell
https://github.com/modernish/modernish
Messages sorted by:
Reverse Date,
Date,
Thread,
Author