diff --git a/src/fish.cpp b/src/fish.cpp index 719777d65..53063e0e5 100644 --- a/src/fish.cpp +++ b/src/fish.cpp @@ -486,6 +486,9 @@ int main(int argc, char **argv) { misc_init(); reader_init(); + // And now enable "job control" for everything. + set_job_control_mode(job_control_t::all); + parser_t &parser = parser_t::principal_parser(); if (!opts.no_exec) { diff --git a/tests/checks/jobs.fish b/tests/checks/jobs.fish index 9f88a7c3a..1df6e7afd 100644 --- a/tests/checks/jobs.fish +++ b/tests/checks/jobs.fish @@ -116,3 +116,14 @@ end emit bar #CHECK: foo #CHECK: caller +# Since we are in a script context, this would not trigger "job control" +# if it was set to "interactive" +status is-full-job-control +and echo is full job control +#CHECK: is full job control + +# We can't rely on a *specific* pgid being assigned, +# but we can rely on it not being fish's. +command true & +set -l truepid $last_pid +test $truepid != $fish_pid || echo true has same pid as fish