From 2631662168f76fca2299edf074a7192f8e85403d Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Thu, 2 Aug 2018 18:22:05 +0300 Subject: [PATCH] fix(linux): fix closing on linux --- src/background/background.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/background/background.js b/src/background/background.js index 6c6c85c..6787025 100644 --- a/src/background/background.js +++ b/src/background/background.js @@ -317,4 +317,20 @@ app.on('before-quit', () => { app.isQuiting = true if (sphinx) stop() -}) \ No newline at end of file +}) + +var rl = require("readline").createInterface({ + input: process.stdin, + output: process.stdout +}); + +rl.on("SIGINT", function () { + process.emit("SIGINT"); +}); + +process.on("SIGINT", () => { + if (sphinx) + stop() + else + app.quit() +});