-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Commander.js signal handling kills process and means sub-commands cant handle signals #1210
Comments
That behaviour got added so that a spawned subcommand would be terminated when the "program" was terminated: #411 #632 I am not sure from your description what your setup is. Do you have a program with a SIGINT handler that calls Would Commander not adding a listener (handler) if there is one already work for your use case? |
An answer was provided, and no further activity in a month. Feel free to open a new issue if it comes up again, with new information and renewed interest. |
Hi, Having an issue that might be related, so I am asking it here: i am starting WebpackDevServer from within a command. Issue is, in my setup, when i press cmd+c the terminal immediately changes as if the command stopped immediately, but then not only it prints additional message from webpack (the one about graceful stopping) but also, the terminal is left in a state where non asci characters (such as up/down arrows) are printed as ^[OA^[OB. Wondering if this behaviour could be related to what is described in this issue. Have to mention that if i send SIGINT from |
Commander only listens for the signals when it is running a subcommand as a stand-alone executable. If you aren't using a subcommand implemented as a stand-alone executable when the problem occurs, then your problem is not related to this issue. |
My command is implemented using the |
commander.js/index.js
Line 785 in 8e1cdf5
In order to get around this, a non-executable command that needs to watch for SIGINT needs to deregister all SIGINT handlers manually in order to capture it itself.
This is a very odd set of behavior.
The text was updated successfully, but these errors were encountered: