From 5c93df921e1d3112f827c81c87424e1bee793594 Mon Sep 17 00:00:00 2001 From: Scott Lowe Date: Wed, 16 Dec 2020 13:03:14 +0100 Subject: [PATCH] Modify handling of SIGINT in balena-dev Change-type: patch Signed-off-by: Scott Lowe --- bin/balena-dev | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/balena-dev b/bin/balena-dev index f9cbb2f8..951cf394 100755 --- a/bin/balena-dev +++ b/bin/balena-dev @@ -21,9 +21,14 @@ modifyOclifPaths(); process.on('exit', function () { modifyOclifPaths(true); }); -// Undo changes in case of ctrl-v +// Undo changes in case of ctrl-c process.on('SIGINT', function () { modifyOclifPaths(true); + // Note process exit here will interfere with commands that do their own SIGINT handling, + // but without it commands can not be exited. + // So currently using balena-dev does not guarantee proper exit behaviour when using ctrl-c. + // Ideally a better solution is needed. + process.exit(); }); // Use fast-boot to cache require lookups, speeding up startup