2020-01-31 07:16:03 +08:00
|
|
|
#RUN: env fth=%fish_test_helper %fish %s
|
|
|
|
|
|
|
|
# Ensure job control works in non-interactive environments.
|
|
|
|
|
|
|
|
status job-control full
|
|
|
|
/bin/echo hello
|
|
|
|
#CHECK: hello
|
|
|
|
|
|
|
|
$fth print_pgrp | read first
|
|
|
|
$fth print_pgrp | read second
|
|
|
|
test $first -ne $second
|
|
|
|
and echo "pgroups differed, meaning job control worked"
|
|
|
|
or echo "pgroups were the same, job control did not work"
|
|
|
|
#CHECK: pgroups differed, meaning job control worked
|
2020-07-27 08:55:00 +08:00
|
|
|
|
|
|
|
# fish ignores SIGTTIN and so may transfer the tty even if it
|
|
|
|
# doesn't own the tty. Ensure that doesn't happen.
|
|
|
|
set -l fish (status fish-path)
|
|
|
|
$fish -c 'status job-control full ; $fth report_foreground' &
|
|
|
|
wait
|
|
|
|
#CHECKERR: background
|