Bug 15940 - jobs omits the last job when run from a subshell
Summary: jobs omits the last job when run from a subshell
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.36.x
Hardware: Macintosh Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-07 01:22 UTC by cheery.hope5461
Modified: 2024-02-07 01:22 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cheery.hope5461 2024-02-07 01:22:22 UTC
Test (to be run from an interactive shell):

vim &
vim &
echo no subshell
jobs
echo subshell
j="$(jobs)"
echo "$j"

Output:

[1] 10523
[2] 10524
no subshell
[1]  - running    vim
[2]  + running    vim
subshell
[1]  - running    vim

Expected output:

[1] 10523
[2] 10524
no subshell
[1]  - running    vim
[2]  + running    vim
subshell
[1]  - running    vim
[2]  + running    vim # <- this is missing when jobs is run from a subshell