From 7a438b3fe7cf2c0864eded891335bdd00648176f Mon Sep 17 00:00:00 2001 From: Alexander Pankratov Date: Tue, 7 May 2024 18:40:04 +0200 Subject: [PATCH] Fix stdout --- src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index c3d37175..6951b5d5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -625,7 +625,12 @@ fn pyspy_main() -> Result<(), Error> { .stdin(std::process::Stdio::null()) .stdout(process_output.reopen()?) .stderr(process_output.reopen()?) - } + } else { + command = command + .stdin(std::process::Stdio::null()) + .stdout(std::process::Stdio::inherit()) + .stderr(std::process::Stdio::inherit()) + } let mut command = command .spawn() @@ -640,6 +645,8 @@ fn pyspy_main() -> Result<(), Error> { } }); + command.wait(); + #[cfg(target_os = "macos")] { // sleep just in case: https://jvns.ca/blog/2018/01/28/mac-freeze/