mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 06:41:42 +08:00
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:
parent
953ab4b3cf
commit
17e815348b
12
proc.cpp
12
proc.cpp
|
@ -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 )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user