Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham
	autolearn_force=no version=3.4.1
X-AuditID: cbfec7f5-f79b16d000005389-97-56c2f29bbbea
Date: Tue, 16 Feb 2016 09:57:44 +0000
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: [BUG] Sticky-sh POSIX_TRAPS are function-local
Message-id: <20160216095744.52cb8389@pwslap01u.europe.root.pri>
In-reply-to: <56C15DF1.8080405@inlv.org>
References: <56C15DF1.8080405@inlv.org>
Organization: Samsung Cambridge Solution Centre
X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu)
MIME-version: 1.0
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7bit
X-Brightmail-Tracker:
 H4sIAAAAAAAAA+NgFjrPLMWRmVeSWpSXmKPExsVy+t/xK7qzPx0KM7j5hcfiYPNDJgdGj1UH
	PzAFMEZx2aSk5mSWpRbp2yVwZZzatpmx4BZ7xaw1PSwNjBPZuhg5OSQETCSOzvjFDGGLSVy4
	tx4ozsUhJLCUUaLx5j5GCGcGk8SCH7NYQKqEBM4xSkx7WAuROMsosfbwIfYuRg4OFgFViaYO
	DpAaNgFDiambZjOC2CIC4hJn154H6xUWsJY4s2UBE4jNK2AvcXPzWbArOAU0JD6e+8gKMV9d
	4sSDxWAX8QvoS1z9+4kJ4jp7iZlXzjBC9ApK/Jh8D2wms4CWxOZtTawQtrzE5jVvmWHm3Li7
	m30Co/AsJC2zkLTMQtKygJF5FaNoamlyQXFSeq6RXnFibnFpXrpecn7uJkZIMH/dwbj0mNUh
	RgEORiUe3g2uh8KEWBPLiitzDzFKcDArifD+ewUU4k1JrKxKLcqPLyrNSS0+xCjNwaIkzjtz
	1/sQIYH0xJLU7NTUgtQimCwTB6dUA2Mmm9Kxjo+yJ/Ztt97FIFZdWNBaqPe9Jm3PpsdzhRaq
	fmKKOq1cmX2kslVQhHFyrZ5jW9mjS1+v+d/79P2x+vlz+vNfvnx6aor10UUWhitTuiyl/q2b
	ovYyKiH16/r7sgs7PT5M+e3Ptul/8eLo2Xvc22cKu4Z/E5qQafWAf6pg5DavVesT52xWYinO
	SDTUYi4qTgQAUiXgR2ICAAA=
X-Seq: zsh-workers 37994

On Mon, 15 Feb 2016 06:11:13 +0100
Martijn Dekker <martijn@inlv.org> wrote:
> The POSIX_TRAPS option for the EXIT trap does not work if both of the
> following conditions apply:

Oh, you mean the POSIXness of the trap is not sticky.  It should be
marked as to be run at the end of the programme based on the emulation
when it was started.  I don't think we've ever claimed it would be,
but it would be clearly be useful to change as the intention in
POSIX emulation is unambiguous.

I think that's probably fixable with a bit of flaggery, but we'll
probably need to compromise and agree that if someone sets an EXIT trap
once the emulation is left, which therefore picks up non-POSIX behaviour
(if that's how the shell was started), it will wipe out the trap
completely.  Otherwise we're in a weird and wonderful world of multiple
parallel EXIT traps.  Presumably that's no big issue, since even in
POSIX mode a new EXIT trap wipes out the one you've just set.

pws

