fix: command prompt was left on quitting

Massimo Melina committed Apr 18, 2026 at 13:37 UTC 60d225de82ab6f1d531569cf88c836899009e557
2 files changed +2 -2
src/commands.ts
+1 -1
@@ -33,6 +33,7 @@ if (!argv.updating && !showHelp) {
33 prompter.prompt(true)
34 isClean = false
35 }, 100)
36 +
37 function clean() {
38 if (isClean) return
39 // keep console methods synchronous: reposition the cursor immediately and let stream ordering preserve output sequence
@@ -53,7 +54,6 @@ if (!argv.updating && !showHelp) {
54 }
55 }
56 }
56 -
57 }
58 catch {
59 console.log("Console commands not available")
src/first.ts
+1 -1
@@ -11,8 +11,8 @@ export function onProcessExit(cb: ProcessExitHandler) {
11 export let quitting = false
12 // 'exit' event is handled as the last resort, but it's not compatible with async callbacks
13 onFirstEvent(process, ['exit', 'SIGQUIT', 'SIGTERM', 'SIGINT', 'SIGHUP'], signal => {
14 - quitting = true
14 console.log('Quitting with signal:', signal || 'unknown')
15 + quitting = true
16 return Promise.allSettled(Array.from(cbsOnExit).map(cb => cb(signal))).then(() => {
17 console.debug('Process exit')
18 process.exit(0)