Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
TRAPDEBUG exit bug?
- X-seq: zsh-workers 35944
- From: Joshua Krusell <js.shirin@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: TRAPDEBUG exit bug?
- Date: Tue, 28 Jul 2015 20:48:09 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; bh=dLxlwrG10e4ubS5ZrJxT8Zwn/XieaRQibo7LTXvYYpU=; b=tl6aPHXom/ssHwNTP5iyQIcIiNwRHvetO1yHqNKAsLbcLr1xCaNyv4IL1+TYdccooj 5G/wgYtMdPbL6TMQpWwNYmHnf9ZropmGqkvdxmw/1k5GZQ3K1JTQN5wd6WVajKYV5obN mTzq0HYkjEc5881+o5i7D2UGYtdCKJczSkMjxv7nSdKPUiVULAGsd1tlvf3TJIl08Xi5 sBjlNv6QkZrmIh8M2p/Vv8h00qAq5NymWUa4JTExOg1jddMrdD2FOk+wJu3YeUxwwvgn CaeGnfsIr8CawOPU02elPVOnF1fs1CCsAldtuEKTGBXbUr3mJTNlqFoTpjBorBY3zgtR Xcjg==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Correct me if I'm wrong, but I couldn't find anything in the docs that
indicate the following is expected behavior w.r.t. TRAPDEBUG.
Setting TRAPDEBUG seems to make zsh unexpectedly emit SIGEXIT after a
command following a failed && or || conditional expr.
trap "" DEBUG
trap "print exit trap" EXIT
for ((i = 0; i < 2; i++)); do
false && :
echo $?
done
$ zsh ./test.sh
1
exit trap
1
Unsetting debug_before_cmd or having more than one command follow
produces the expected behavior.
Ex:
trap "" DEBUG
trap "print exit trap" EXIT
for ((i = 0; i < 2; i++)); do
false && :
echo $?
:
done
$ zsh ./test.sh
1
1
exit trap
Reproducible since patch 27947.
/jsks
Messages sorted by:
Reverse Date,
Date,
Thread,
Author