From d057382fc0fccf7de951d1a983c0f8834bd3544e Mon Sep 17 00:00:00 2001 From: Ronald Pijnacker Date: Mon, 20 Apr 2020 09:21:01 +0200 Subject: [PATCH] Fix Ctrl-C handling --- src/Tunnel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tunnel.ts b/src/Tunnel.ts index 054a6c4..61fd0a6 100644 --- a/src/Tunnel.ts +++ b/src/Tunnel.ts @@ -458,8 +458,8 @@ export default class Tunnel extends Evented let canceled = false; // Ensure child process is killed when parent exits + process.on('SIGINT', () => process.exit(1)); process.on('exit', () => kill(child.pid)); - process.on('SIGINT', () => kill(child.pid)); const task = new Task( (resolve, reject) => {