2018-03-04 21:33:36 +00:00
|
|
|
jobs -q; echo $status
|
2017-04-02 15:02:55 +00:00
|
|
|
sleep 5 &
|
|
|
|
sleep 5 &
|
2016-06-08 23:09:29 +00:00
|
|
|
jobs -c
|
2018-03-04 21:33:36 +00:00
|
|
|
jobs -q; echo $status
|
2018-04-01 20:43:05 +00:00
|
|
|
bg -23 1 2>/dev/null
|
2017-06-15 01:25:51 +00:00
|
|
|
or echo bg: invalid option -23 >&2
|
2016-07-06 06:12:28 +00:00
|
|
|
fg 3
|
2017-04-02 15:02:55 +00:00
|
|
|
bg 3
|
2017-03-23 00:50:57 +00:00
|
|
|
sleep 1 &
|
|
|
|
disown
|
|
|
|
jobs -c
|
|
|
|
disown foo
|
|
|
|
disown (jobs -p)
|
2016-07-06 06:12:28 +00:00
|
|
|
or exit 0
|
2019-04-19 06:08:16 +00:00
|
|
|
|
2019-04-19 07:20:55 +00:00
|
|
|
# Verify `jobs` output within a function lists background jobs
|
2019-04-19 06:08:16 +00:00
|
|
|
# https://github.com/fish-shell/fish-shell/issues/5824
|
|
|
|
function foo
|
2019-04-19 07:20:55 +00:00
|
|
|
sleep 0.2 &
|
|
|
|
jobs -c
|
2019-04-19 06:08:16 +00:00
|
|
|
end
|
|
|
|
foo
|
2019-05-01 23:17:23 +00:00
|
|
|
|
|
|
|
# Verify we observe job exit events
|
|
|
|
sleep 1 &
|
|
|
|
set sleep_job $last_pid
|
|
|
|
function sleep_done_$sleep_job --on-job-exit $sleep_job
|
|
|
|
/bin/echo "sleep is done"
|
|
|
|
functions --erase sleep_done_$sleep_job
|
|
|
|
end
|
|
|
|
sleep 2
|
2019-09-11 05:17:23 +00:00
|
|
|
|
|
|
|
# Verify `jobs -l` works and returns the right status codes
|
|
|
|
# https://github.com/fish-shell/fish-shell/issues/6104
|
|
|
|
jobs --last --command; echo $status
|
|
|
|
sleep 0.2 &
|
|
|
|
jobs -lc; echo $status
|