-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support passing SIGINT
to scripts that are running via devbox run
#1815
Comments
It does seem to be working some of the time. I've yet to determine why is it not working all the time. Some scripts correctly respond to SIGINT when run but they don't when run via |
This seems similar to the issues that this PR fixed in dagger: dagger/dagger#5712 Their change is essentially doing the following to nix/run.go: cmd := exec.CommandContext(ctx, shPath, "-c", cmdWithArgs)
cmd.Env = envPairs
cmd.Dir = projectDir
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Cancel = func() error {
return syscall.Kill(cmd.Process.Pid, syscall.SIGTERM)
} With my limited testing, this seems to fix the issue. |
Thanks for the submitting a PR with your fix. I'd still like to understand a bit more why this is happening. Could you provide a few more details?
When I try to repro using this config: {
"shell": {
"scripts": {
"zzz": "/bin/sleep 5"
}
}
} and run |
@gcurtis Here is some more info:
|
What problem are you trying to solve?
Scripts run via
devbox run
cannot be cancelled withSIGINT
.What solution would you like?
Handle the SIGINT signal and pass it to the script being execute by
devbox run
.Alternatives you've considered
Not running scripts via devbox. That is not desirable as the scripts defined in
devbox.json
provide a great way to catalog functionality.The text was updated successfully, but these errors were encountered: