Merge pull request #664 from jonathandturner/detach_externals

Detach externals so they don't freeze while buffering
This commit is contained in:
Jonathan Turner 2019-09-14 06:11:59 +12:00 committed by GitHub
commit 52e71cad18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 {});