From 30a8c17bd00291672c086efd3b6635d956e78663 Mon Sep 17 00:00:00 2001 From: Mostafa-M-Hussein Date: Tue, 5 May 2026 17:07:02 +0300 Subject: [PATCH] [fix] : interactive mode exits after first prompt ora's spinner detaches stdin when it stops, which causes readline to receive EOF and fire 'close' on the next tick. The 'close' handler calls process.exit(0), so the session dies right after the first response prints. Pause readline while the spinner is running and resume it in finally so the stdin stream stays attached to readline. --- src/commands/interactive.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/commands/interactive.ts b/src/commands/interactive.ts index df95339..290e19e 100644 --- a/src/commands/interactive.ts +++ b/src/commands/interactive.ts @@ -42,6 +42,7 @@ export async function interactiveCommand(config: Config): Promise { } if (trimmed) { + rl.pause(); const spinner = ora('Thinking...').start(); try { @@ -51,6 +52,8 @@ export async function interactiveCommand(config: Config): Promise { } catch (error) { spinner.stop(); console.error(chalk.red('Error:'), error instanceof Error ? error.message : error); + } finally { + rl.resume(); } }