Skip to content

Commit

Permalink
Don't keep subcommand stdout around
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
th1000s authored and dandavison committed Dec 2, 2024
1 parent 31296e7 commit 440cdd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ pub fn run_app(

let cmd_stdout = cmd
.stdout
.as_mut()
.take()
.unwrap_or_else(|| panic!("Failed to open stdout"));
let cmd_stdout_buf = io::BufReader::new(cmd_stdout);

Expand Down

0 comments on commit 440cdd3

Please sign in to comment.