From 59d223c0b9bcab34fc36c6703b584528bc4a3966 Mon Sep 17 00:00:00 2001 From: Chris Olszewski Date: Thu, 25 Jul 2024 10:47:22 -0500 Subject: [PATCH] fix: close stdin for non-interactive tasks --- crates/turborepo-lib/src/task_graph/visitor.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/turborepo-lib/src/task_graph/visitor.rs b/crates/turborepo-lib/src/task_graph/visitor.rs index 3852edf766f63..605a392ba254c 100644 --- a/crates/turborepo-lib/src/task_graph/visitor.rs +++ b/crates/turborepo-lib/src/task_graph/visitor.rs @@ -952,6 +952,13 @@ impl ExecContext { } } + // Even if user does not have the TUI and cannot interact with a task, we keep + // stdin open for persistent tasks as some programs will shut down if stdin is + // closed. + if !self.takes_input { + process.stdin(); + } + let mut stdout_writer = self .task_cache .output_writer(prefixed_ui.task_writer())