mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-04 07:21:14 -03:00
Fix wrong exit code for jobs #2505
This commit is contained in:
committed by
ridiculousfish
parent
d325b4bf39
commit
2d90859cab
@@ -254,15 +254,6 @@ static int builtin_jobs(parser_t &parser, io_streams_t &streams, wchar_t **argv)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Do not babble if not interactive
|
||||
*/
|
||||
if (streams.out_is_redirected)
|
||||
{
|
||||
found=1;
|
||||
}
|
||||
|
||||
if (print_last)
|
||||
{
|
||||
/*
|
||||
@@ -275,7 +266,7 @@ static int builtin_jobs(parser_t &parser, io_streams_t &streams, wchar_t **argv)
|
||||
|
||||
if ((j->flags & JOB_CONSTRUCTED) && !job_is_completed(j))
|
||||
{
|
||||
builtin_jobs_print(j, mode, !found, streams);
|
||||
builtin_jobs_print(j, mode, !streams.out_is_redirected, streams);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -287,8 +278,6 @@ static int builtin_jobs(parser_t &parser, io_streams_t &streams, wchar_t **argv)
|
||||
{
|
||||
int i;
|
||||
|
||||
found = 1;
|
||||
|
||||
for (i=w.woptind; i<argc; i++)
|
||||
{
|
||||
int pid;
|
||||
@@ -307,7 +296,8 @@ static int builtin_jobs(parser_t &parser, io_streams_t &streams, wchar_t **argv)
|
||||
|
||||
if (j && !job_is_completed(j))
|
||||
{
|
||||
builtin_jobs_print(j, mode, !found, streams);
|
||||
builtin_jobs_print(j, mode, false, streams);
|
||||
found = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -338,9 +328,15 @@ static int builtin_jobs(parser_t &parser, io_streams_t &streams, wchar_t **argv)
|
||||
|
||||
if (!found)
|
||||
{
|
||||
streams.out.append_format(
|
||||
_(L"%ls: There are no jobs\n"),
|
||||
argv[0]);
|
||||
/*
|
||||
Do not babble if not interactive
|
||||
*/
|
||||
if (streams.out_is_redirected)
|
||||
{
|
||||
streams.out.append_format(
|
||||
_(L"%ls: There are no jobs\n"),
|
||||
argv[0]);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user