diff --git a/src/builtin_jobs.cpp b/src/builtin_jobs.cpp index 406795aa3..f5f7a0592 100644 --- a/src/builtin_jobs.cpp +++ b/src/builtin_jobs.cpp @@ -204,7 +204,7 @@ int builtin_jobs(parser_t &parser, io_streams_t &streams, wchar_t **argv) { while ((j = jobs.next())) { // Ignore unconstructed jobs, i.e. ourself. if ((j->flags & JOB_CONSTRUCTED) && !job_is_completed(j)) { - builtin_jobs_print(j, mode, !streams.out_is_redirected, streams); + builtin_jobs_print(j, mode, !found && !streams.out_is_redirected, streams); found = 1; } } diff --git a/tests/jobs.err b/tests/jobs.err new file mode 100644 index 000000000..e69de29bb diff --git a/tests/jobs.in b/tests/jobs.in new file mode 100644 index 000000000..c32b9b376 --- /dev/null +++ b/tests/jobs.in @@ -0,0 +1,3 @@ +sleep 1 & +sleep 1 & +jobs -c diff --git a/tests/jobs.out b/tests/jobs.out new file mode 100644 index 000000000..702f017fa --- /dev/null +++ b/tests/jobs.out @@ -0,0 +1,3 @@ +Command +sleep +sleep diff --git a/tests/jobs.status b/tests/jobs.status new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/tests/jobs.status @@ -0,0 +1 @@ +0