Fix to drain command output from quit commands before returning from job_continue

This should fix the bug where output from commands and builtins gets incorrectly interleaved.
I think this is a very long-standing bug that predates my work on the shell
This commit is contained in:
ridiculousfish 2012-04-25 13:26:56 -07:00
parent 953ab4b3cf
commit 17e815348b

View File

@ -1057,9 +1057,15 @@ void job_continue (job_t *j, int cont)
got_signal = 0;
quit = job_is_stopped( j ) || job_is_completed( j );
}
while( got_signal && !quit )
;
while (got_signal && !quit);
if (quit) {
// It's possible that the job will produce output and exit before we've even read from it.
// We'll eventually read the output, but it may be after we've executed subsequent calls
// This is why my prompt colors kept getting screwed up - the builtin echo calls
// were sometimes having their output combined with the set_color calls in the wrong order!
read_try(j);
}
if( !quit )
{