diff --git a/src/builtins/bg.rs b/src/builtins/bg.rs index 10373603a..33cd32aa0 100644 --- a/src/builtins/bg.rs +++ b/src/builtins/bg.rs @@ -17,12 +17,13 @@ fn send_to_bg( let err = { let job = &jobs[job_pos]; wgettext_fmt!( - "%ls: Can't put job %s, '%ls' to background because it is not under job control\n", - cmd, - job.job_id().to_wstring(), - job.command() - ) + "%ls: Can't put job %s, '%ls' to background because it is not under job control\n", + cmd, + job.job_id().to_wstring(), + job.command() + ) }; + drop(jobs); builtin_print_help_error(parser, streams, cmd, &err); return STATUS_CMD_ERROR; } diff --git a/tests/checks/job-control-noninteractive.fish b/tests/checks/job-control-noninteractive.fish index da4566306..a2cc3c716 100644 --- a/tests/checks/job-control-noninteractive.fish +++ b/tests/checks/job-control-noninteractive.fish @@ -18,3 +18,6 @@ or echo "pgroups were the same, job control did not work" $fish -c 'status job-control full ; $fth report_foreground' & wait #CHECKERR: background + +$fish -c 'sleep .2 & bg %1' +#CHECKERR: bg: Can't put job 1, 'sleep .2 &' to background because it is not under job control