don't print header for each job

This commit is contained in:
Corey Ford 2016-06-08 16:09:29 -07:00 committed by Kurtis Rader
parent 8829bb1364
commit 9d2092bf9f
5 changed files with 8 additions and 1 deletions

View file

@ -204,7 +204,7 @@ int builtin_jobs(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
while ((j = jobs.next())) { while ((j = jobs.next())) {
// Ignore unconstructed jobs, i.e. ourself. // Ignore unconstructed jobs, i.e. ourself.
if ((j->flags & JOB_CONSTRUCTED) && !job_is_completed(j)) { 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; found = 1;
} }
} }

0
tests/jobs.err Normal file
View file

3
tests/jobs.in Normal file
View file

@ -0,0 +1,3 @@
sleep 1 &
sleep 1 &
jobs -c

3
tests/jobs.out Normal file
View file

@ -0,0 +1,3 @@
Command
sleep
sleep

1
tests/jobs.status Normal file
View file

@ -0,0 +1 @@
0