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

Re: trap, eval and wait (was: [BUG] exec + builtin and traps)

On Tue, 12 Sep 2017 16:04:09 +0100
Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> Quite possibly any of the above flags should mean wait ignores the job,
> but I've taken STAT_NOPRINT as the most logical to test here as it
> basically means "user is not interested in this".

I've committed this but I'm wondering if it would be sensible to add
STAT_DONE here? There's nothing to wait for if the job is done.
(This case is only for "wait" without an argument, so just wait for
everything we think is outstanding.)

By the way, unrelated to the bug (though it works around it), if you're
really interested in the status of the last background job, I think you
need to use "wait $!" anyway --- otherwise if the job is already
finished, "wait" will simply return immediately with status 0.  Waiting
for $! is the only special case available to handle the race.


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