forked from extern/nushell
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 {
|
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 => {
|
||||||
|
Loading…
Reference in New Issue
Block a user