Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] ignored trap and subshell



On Tue, Aug 24, 2021 at 10:29 AM Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Tue, Aug 24, 2021 at 9:24 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> >
> > However, with "emulate sh", ignored traps should still be ignored
> > in the subshell according to POSIX, and zsh 5.8 fails do conform:
>
> "emulate sh" is NOT the same as "ARGV0=sh", and is never going to be.

However, it appears this behavior isn't covered in regular sh emulation either:

% ARGV0=sh Src/zsh -c 'trap "" INT; trap; echo A; ( trap; echo B;
sleep 3; ); echo $?'
trap -- '' INT
A
B
^C130

So we should look into this.




Messages sorted by: Reverse Date, Date, Thread, Author