Skip to content

Commit

Permalink
Add docs for signal handling (#11041)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zanieb authored Jan 29, 2025
1 parent e7fc05e commit 48976e1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/concepts/projects/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 48976e1

Please sign in to comment.