mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 16:33:37 +01:00
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:
parent
452f96a836
commit
e2b9370f10
@ -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 => {
|
||||
|
Loading…
Reference in New Issue
Block a user