Detach externals so they don't freeze while buffering

This commit is contained in:
Jonathan Turner 2019-09-14 05:51:40 +12:00
parent da31eac735
commit 9382a7e64a

View File

@ -307,10 +307,12 @@ impl ExternalCommand {
Ok(ClassifiedInputStream::new())
}
StreamNext::External => {
let _ = popen.detach();
let stdout = popen.stdout.take().unwrap();
Ok(ClassifiedInputStream::from_stdout(stdout))
}
StreamNext::Internal => {
let _ = popen.detach();
let stdout = popen.stdout.take().unwrap();
let file = futures::io::AllowStdIo::new(stdout);
let stream = Framed::new(file, LinesCodec {});