mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-29 10:31:14 -03:00
Reimplement builtin_wait using wait handles
This switches builtin_wait from waiting on jobs in the active job list, to waiting on the wait handles. The wait handles may be either derived from the job list itself, or from saved wait handles from jobs that exited in the background. Fixes #7210
This commit is contained in:
26
tests/checks/wait.fish
Normal file
26
tests/checks/wait.fish
Normal file
@@ -0,0 +1,26 @@
|
||||
# RUN: %fish %s
|
||||
|
||||
# Ensure that we can wait for stuff.
|
||||
status job-control full
|
||||
|
||||
set pids
|
||||
|
||||
for i in (seq 16)
|
||||
command true &
|
||||
set -a pids $last_pid
|
||||
command false &
|
||||
set -a pids $last_pid
|
||||
end
|
||||
|
||||
# Note fish does not (yet) report the exit status of waited-on commands.
|
||||
for pid in $pids
|
||||
wait $pid
|
||||
end
|
||||
|
||||
for i in (seq 16)
|
||||
command true &
|
||||
command false &
|
||||
end
|
||||
wait true false
|
||||
jobs
|
||||
# CHECK: jobs: There are no jobs
|
||||
Reference in New Issue
Block a user