webpack-dashboard icon indicating copy to clipboard operation
webpack-dashboard copied to clipboard

Handle SIGQUIT

Open jasontwong opened this issue 8 years ago • 2 comments

For some reason the process doesn't quit with Ctrl + \ but does with Ctrl + c.

SIGQUIT is the dump core signal. The terminal sends it to the foreground process when the user presses ctrl-\. The default behavior is to terminate the process and dump core, but it can be caught or ignored. The intention is to provide a mechanism for the user to abort the process.

jasontwong avatar Aug 25 '16 14:08 jasontwong

@kenwheeler For some reason the following piece of code isn't being recognised by Node. Also, listening for the 'C-' event doesn't work since the backslash will need to be escaped (and isn't recognised as a valid key combination anymore).

process.on("SIGQUIT", function () {
  process.exit(0);
});

Other terminal apps, like Node itself, don't quit with Ctrl + \ either. Is this still a valid way to quit processes?

vernondegoede avatar Nov 15 '16 16:11 vernondegoede

express and webpack --watch work with Ctrl + \. So does irb, yes, grep, etc. But you are correct that the node REPL does not support it. Maybe it should be handled upstream on node?

jasontwong avatar Nov 15 '16 18:11 jasontwong