Skip to content
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

Proxy exit signals from foreground processes #16

Merged
merged 4 commits into from
Nov 6, 2020

Conversation

isaacs
Copy link
Contributor

@isaacs isaacs commented Nov 6, 2020

This makes it so that the main process will be terminated with the same
signal that a foreground (ie, stdio: 'inherit') process receives.

Thus, if you kick off a long-running script with npm run, and then
^C to terminate it, the main process will exit with that signal,
instead of treating the signal exit as an error and printing npm's error
banner.

Fixes: npm/cli#2124

References

This makes it so that the main process will be terminated with the same
signal that a foreground (ie, `stdio: 'inherit'`) process receives.

Thus, if you kick off a long-running script with `npm run`, and then
`^C` to terminate it, the main process will exit with that signal,
instead of treating the signal exit as an error and printing npm's error
banner.

Fixes: npm/cli#2124
@isaacs isaacs merged commit 1ba5c65 into master Nov 6, 2020
@lukekarrys lukekarrys deleted the isaacs/better-signal-proxying branch February 23, 2022 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] SIGINT (ctrl+c) makes npm 7 print error log
2 participants