Attempt to fix issue with ^C in Windows

This fixes the error case if we ^C during running an external command.  This needs testing across platforms before it lands.
This commit is contained in:
Jonathan Turner 2019-09-07 16:59:13 +12:00 committed by GitHub
parent 452f96a836
commit e2b9370f10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -342,7 +342,19 @@ impl ExternalCommand {
match stream_next {
StreamNext::Last => {
popen.wait()?;
let _ = popen.detach();
loop {
match popen.poll() {
None => {
let _ = std::thread::sleep(std::time::Duration::new(0, 100000000));
}
_ => {
let _ = popen.terminate();
break;
}
}
}
println!("");
Ok(ClassifiedInputStream::new())
}
StreamNext::External => {