fish-shell/tests/checks/job-control-noninteractive.fish
Fabian Homborg f6bba5ceb4 tests: Pass $fish as a variable in some cases
I am not sure why this worked, actually.

These tests did not have $fish set anywhere, and on my fresh OpenBSD
VM it ended up calling whatever that calls "fish" (I think it's that
"Go fish!" game?).
2020-10-06 17:40:22 +02:00

21 lines
653 B
Fish

#RUN: env fth=%fish_test_helper fish=%fish %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
# 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