-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Calling log-update breaks SIGINT signal handlers #17
Comments
laurynaslubys
changed the title
Calling log-update break SIGINT signal handlers
Calling log-update breaks SIGINT signal handlers
Apr 17, 2017
Any ETA on when this will be released? |
okonet
pushed a commit
to okonet/listr-update-renderer
that referenced
this issue
Sep 13, 2018
This version should fix issues related to processing of SIGINT signal. See sindresorhus/log-update#17. Related to SamVerschueren/listr#85
For some reason import logUpdate from "log-update"
logUpdate("test")
setInterval(() => console.log(new Date()), 1000)
// Try to Ctrl-C... A workaround is to manually clear an interval. process.on("SIGINT", () => {
clearInterval(interval)
logUpdate.done()
}) Still I'm curios why it happens... if someone knows – please share 🙏 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems that using this library breaks the expected behaviour of SIGINT listeners. If logUpdate is used before registering a SIGINT listener, the listener is not called at all and the process exits immediately, if logUpdate is first called after registering a listener, the listener is called, but the process still exits. If logUpdate is not called, the code below doesn't exit of first SIGINT, but does so on the second one (which is the expected behaviour)
Uncommenting only the first usage yields
Uncommenting only the second usage yields
Uncommenting both yields
Tested on node v6.10.1 and v7.7.4, macOS 10.12.3 (16D32)
The text was updated successfully, but these errors were encountered: