From 32ead8a75a0eccf4cf41a4961c1b14fc47b4a1cb Mon Sep 17 00:00:00 2001 From: Yuxuan Zhang Date: Fri, 5 Jan 2024 12:11:27 -0500 Subject: [PATCH] fix(cli/shortcuts): CTRL-C should be considered normal exit --- src/node/shortcuts.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/node/shortcuts.ts b/src/node/shortcuts.ts index 84aa03ec..ff0c64df 100644 --- a/src/node/shortcuts.ts +++ b/src/node/shortcuts.ts @@ -33,8 +33,10 @@ export function bindShortcuts( const onInput = async (input: string) => { // ctrl+c or ctrl+d if (input === '\x03' || input === '\x04') { - await server.close().finally(() => process.exit(1)) - return + await server + .close() + .catch(() => (process.exitCode = 1)) + .finally(() => process.exit()) } if (actionRunning) return