[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 5.3-alpha: the `jobs' builtin prints foreground dead jobs with funct
From: |
Chet Ramey |
Subject: |
Re: 5.3-alpha: the `jobs' builtin prints foreground dead jobs with function substitutions |
Date: |
Fri, 3 May 2024 10:36:09 -0400 |
User-agent: |
Mozilla Thunderbird |
On 5/1/24 10:38 PM, Koichi Murase wrote:
2024年5月1日(水) 22:58 Chet Ramey <chet.ramey@case.edu>:
Yes, and I said I could work around this case.
Thank you for your consideration.
[1] https://lists.gnu.org/archive/html/bug-bash/2022-10/threads.html#00054
[2] https://lists.gnu.org/archive/html/bug-bash/2022-11/threads.html#00049
(continued. I haven't received a reply)
To what?
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.
OK. The standard does say "reporting the exit status with the special
parameter '?'" in
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_02
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/
OpenPGP_signature.asc
Description: OpenPGP digital signature
- Re: 5.3-alpha: the `jobs' builtin prints foreground dead jobs with function substitutions, Chet Ramey, 2024/05/01
- Re: 5.3-alpha: the `jobs' builtin prints foreground dead jobs with function substitutions, Koichi Murase, 2024/05/01
- Re: 5.3-alpha: the `jobs' builtin prints foreground dead jobs with function substitutions,
Chet Ramey <=
- Re: 5.3-alpha: the `jobs' builtin prints foreground dead jobs with function substitutions, Koichi Murase, 2024/05/04
- Re: 5.3-alpha: the `jobs' builtin prints foreground dead jobs with function substitutions, Chet Ramey, 2024/05/06
- Re: 5.3-alpha: the `jobs' builtin prints foreground dead jobs with function substitutions, Koichi Murase, 2024/05/06
- Re: 5.3-alpha: the `jobs' builtin prints foreground dead jobs with function substitutions, Koichi Murase, 2024/05/06
- Re: 5.3-alpha: the `jobs' builtin prints foreground dead jobs with function substitutions, Chet Ramey, 2024/05/06
- Re: 5.3-alpha: the `jobs' builtin prints foreground dead jobs with function substitutions, Robert Elz, 2024/05/06