fix(cli/shortcuts): CTRL-C should be considered normal exit

pull/3419/head
Yuxuan Zhang 2 years ago committed by GitHub
parent f1425432b6
commit 32ead8a75a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,8 +33,10 @@ export function bindShortcuts(
const onInput = async (input: string) => { const onInput = async (input: string) => {
// ctrl+c or ctrl+d // ctrl+c or ctrl+d
if (input === '\x03' || input === '\x04') { if (input === '\x03' || input === '\x04') {
await server.close().finally(() => process.exit(1)) await server
return .close()
.catch(() => (process.exitCode = 1))
.finally(() => process.exit())
} }
if (actionRunning) return if (actionRunning) return

Loading…
Cancel
Save