From 440cdd35dcdab4dc6c00231935411910be628983 Mon Sep 17 00:00:00 2001 From: Thomas Otto Date: Mon, 2 Dec 2024 23:21:08 +0100 Subject: [PATCH] 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. --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 5080dd3b6..e952a3bcb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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);