Merge pull request #609 from nushell/jonathandturner-patch-2

Attempt to fix issue with ^C in Windows
This commit is contained in:
Jonathan Turner 2019-09-07 19:38:25 +12:00 committed by GitHub
commit ffaf17945d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -342,7 +342,19 @@ impl ExternalCommand {
match stream_next { match stream_next {
StreamNext::Last => { 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()) Ok(ClassifiedInputStream::new())
} }
StreamNext::External => { StreamNext::External => {