mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
job: Only force-close stdout/stderr when the job exits
stdout/stderr should only be closed after the job truly exits, or else we can lose data sent by it.
This commit is contained in:
@@ -270,10 +270,10 @@ void job_stop(Job *job)
|
||||
}
|
||||
|
||||
job->stopped_time = os_hrtime();
|
||||
// Close the standard streams of the job
|
||||
// Close the job's stdin. If the job doesn't close it's own stdout/stderr,
|
||||
// they will be closed when the job exits(possibly due to being terminated
|
||||
// after a timeout)
|
||||
close_job_in(job);
|
||||
close_job_out(job);
|
||||
close_job_err(job);
|
||||
|
||||
if (!stop_requests++) {
|
||||
// When there's at least one stop request pending, start a timer that
|
||||
|
Reference in New Issue
Block a user