To the email [2]. In particular, to the question in the second paragraph [2].
OK. No, it doesn't make sense to do that.
The better option is to change the notification strategy so that the jobs
list doesn't contain terminated unnotified foreground jobs when run in a
trap.
I assume a similar solution would work for `bind -x' and $PROMPT_COMMAND,
but I haven't looked at those yet.
I'm not sure about the answer, but kre's opinion seems reasonable to
me.
I think the description of the standard is still unclear, or the
standard doesn't try to specify this detail.
Probably the latter.
and hit the `sleep' with SIGUSR1 from another process, all shells will
print some message about the process exiting due to SIGUSR1 before `jobs'
is executed, and `jobs' prints nothing, because the reporting has already
happened.
In that theory, what happens when `sleep 20' is successfully
terminated without any signals?
Shells wouldn't, and don't, notify about that.
With this interpretation, the `jobs' builtin will never print
foreground jobs because, at the point when the `jobs' builtin is
running in the foreground, any other foreground jobs should have been
terminated (while setting $?) or turned into background jobs as no
more than one jobs can run in the foreground at the same time.
Sure. In addition, I want to preserve the behavior of notifying about
terminated foreground jobs that were killed by a signal we don't ignore.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/