From f706a4bde21c214d0dbe381fa58c0349183368fc Mon Sep 17 00:00:00 2001 From: Joakim Carlstein Date: Mon, 25 Feb 2019 15:39:34 +0100 Subject: [PATCH] Send SIGINT on Ctrl+C For a process to have a change for a graceful shutdown a SIGINT signal is sent when Ctrl+C is pressed instead of exiting the process immediately. Blessed already have a registered SIGINT handler which calls `process.exit(0)` if no other handlers exist (https://github.com/chjj/blessed/blob/master/lib/widgets/screen.js#L232) --- lib/dashboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dashboard.js b/lib/dashboard.js index 26736f3..d59f820 100644 --- a/lib/dashboard.js +++ b/lib/dashboard.js @@ -52,7 +52,7 @@ Dashboard.prototype._configureKeys = function () { // this key will be watched on the global screen this.screen.ignoreLocked = ["C-c"]; this.screen.key("C-c", function () { - process.exit(0); // eslint-disable-line no-process-exit + process.kill(process.pid, "SIGINT"); }); // watch for key events on the main container; not the screen