fix(cli-run): silence wait noise and suppress raw arrow escape input

This commit is contained in:
YeonGyu-Kim
2026-02-18 17:25:13 +09:00
parent a60a153d19
commit 5bb0e69dea
5 changed files with 245 additions and 11 deletions
+10 -2
View File
@@ -9,6 +9,7 @@ import { executeOnCompleteHook } from "./on-complete-hook"
import { resolveRunAgent } from "./agent-resolver"
import { pollForCompletion } from "./poll-for-completion"
import { loadAgentProfileColors } from "./agent-profile-colors"
import { suppressRunInput } from "./stdin-suppression"
export { resolveRunAgent }
@@ -53,11 +54,15 @@ export async function run(options: RunOptions): Promise<number> {
serverCleanup()
}
process.on("SIGINT", () => {
const restoreInput = suppressRunInput()
const handleSigint = () => {
console.log(pc.yellow("\nInterrupted. Shutting down..."))
restoreInput()
cleanup()
process.exit(130)
})
}
process.on("SIGINT", handleSigint)
try {
const sessionID = await resolveSession({
@@ -124,6 +129,9 @@ export async function run(options: RunOptions): Promise<number> {
} catch (err) {
cleanup()
throw err
} finally {
process.removeListener("SIGINT", handleSigint)
restoreInput()
}
} catch (err) {
if (jsonManager) jsonManager.restore()