From 48976e12e8ba9ff9e13aa100a8b8038ed18357d5 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 29 Jan 2025 08:27:52 -0600 Subject: [PATCH] Add docs for signal handling (#11041) I'm not sure if this should go in the CLI reference or not? but here seems like an okay start. I want to figure out a way to avoid repeating this content. --- docs/concepts/projects/run.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/concepts/projects/run.md b/docs/concepts/projects/run.md index 4d0f1e53e185..73cdf7bf4eb6 100644 --- a/docs/concepts/projects/run.md +++ b/docs/concepts/projects/run.md @@ -63,3 +63,16 @@ print([(k, v["title"]) for k, v in data.items()][:10]) The invocation `uv run example.py` would run _isolated_ from the project with only the given dependencies listed. + +## Signal handling + +uv does not cede control of the process to the spawned command in order to provide better error +messages on failure. Consequently, uv is responsible for forwarding some signals to the child +process the requested command runs in. + +On Unix systems, uv will forward SIGINT and SIGTERM to the child process. Since shells send SIGINT +to the foreground process group on Ctrl-C, uv will only forward a SIGINT to the child process if it +is seen more than once or the child process group differs from uv's. + +On Windows, these concepts do not apply and uv ignores Ctrl-C events, deferring handling to the +child process so it can exit cleanly.