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.
This commit is contained in:
Zanie Blue 2025-01-29 08:27:52 -06:00 committed by GitHub
parent e7fc05e460
commit 48976e12e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.