diff --git a/crates/uv/src/commands/run.rs b/crates/uv/src/commands/run.rs index 8b4ceaf2d..6a8033fff 100644 --- a/crates/uv/src/commands/run.rs +++ b/crates/uv/src/commands/run.rs @@ -17,12 +17,11 @@ pub(crate) async fn run_to_completion(mut handle: Child) -> anyhow::Result`), the process group is not involved and a signal is not sent - // to the child by default. In this context, uv must forward the signal to the child. We work - // around this by forwarding SIGINT if it is received more than once. We could attempt to infer - // if the parent is a terminal using TTY detection(?), but there hasn't been sufficient - // motivation to explore alternatives yet. + // Note the above only applies in an interactive terminal. If a signal is sent directly to the + // uv parent process (e.g., `kill -2 `), the process group is not involved and a signal is + // not sent to the child by default. In this context, uv must forward the signal to the child. + // uv checks if stdin is a TTY as a heuristic to determine if uv is running in an interactive + // terminal. When not in an interactive terminal, uv will forward SIGINT to the child. // // Use of SIGTERM is also a bit complicated. If a terminal receives a SIGTERM, it just waits for // its children to exit — multiple SIGTERMs do not have any effect and the signals are not @@ -38,6 +37,7 @@ pub(crate) async fn run_to_completion(mut handle: Child) -> anyhow::Result anyhow::Result anyhow::Result anyhow::Result