Skip to content

Commit 440cdd3

Browse files
th1000sdandavison
authored andcommitted
Don't keep subcommand stdout around
take() and pass it to BufReader so it gets closed when the reader stops. Otherwise on an early pager (EPIPE), and thus delta() exit the feeding subcommand still has an open stdout to write something into and wait()-ing on it hangs.
1 parent 31296e7 commit 440cdd3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ pub fn run_app(
228228

229229
let cmd_stdout = cmd
230230
.stdout
231-
.as_mut()
231+
.take()
232232
.unwrap_or_else(|| panic!("Failed to open stdout"));
233233
let cmd_stdout_buf = io::BufReader::new(cmd_stdout);
234234

0 commit comments

Comments
 (0)