From 114629ff9e6e57ad874f601fd5e06f4383d415c1 Mon Sep 17 00:00:00 2001 From: Askhz <1361267452@qq.com> Date: Thu, 9 Apr 2026 10:25:34 +0800 Subject: [PATCH] fix(interactive): stop early input capture before rendering dialogs Rename CLI binary from `ccb` to `csc`, update .gitignore for additional AI tool directories and exe files, and fix unresponsive keyboard input in interactive dialogs by stopping the early input listener before Ink takes over stdin. --- .gitignore | 3 +++ package.json | 2 +- src/interactiveHelpers.tsx | 9 +++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8b5e47a0e..4c0dc6072 100644 --- a/.gitignore +++ b/.gitignore @@ -8,12 +8,15 @@ coverage .vscode *.suo *.lock +*.exe src/utils/vendor/ # AI tool runtime directories .agents/ .codex/ .omx/ +.claude/ +.costrict/ # Binary / screenshot files (root only) /*.png diff --git a/package.json b/package.json index 586b78fbe..e0049bf18 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "bun": ">=1.2.0" }, "bin": { - "ccb": "dist/cli.js", + "csc": "dist/cli.js", "claude-code-best": "dist/cli.js" }, "workspaces": [ diff --git a/src/interactiveHelpers.tsx b/src/interactiveHelpers.tsx index 3c9946b29..e0488dc59 100644 --- a/src/interactiveHelpers.tsx +++ b/src/interactiveHelpers.tsx @@ -50,6 +50,7 @@ import { updateGithubRepoPathMapping } from './utils/githubRepoPathMapping.js' import { applyConfigEnvironmentVariables } from './utils/managedEnv.js' import type { PermissionMode } from './utils/permissions/PermissionMode.js' import { getBaseRenderOptions } from './utils/renderOptions.js' +import { stopCapturingEarlyInput } from './utils/earlyInput.js' import { getSettingsWithAllErrors } from './utils/settings/allErrors.js' import { hasAutoModeOptIn, @@ -152,6 +153,14 @@ export async function showSetupScreens( claudeInChrome?: boolean, devChannels?: ChannelEntry[], ): Promise { + // Stop early input capture before rendering any interactive dialog. + // The early input listener registered in startCapturingEarlyInput() competes + // with Ink's stdin listener — both are 'readable' handlers and whichever fires + // first consumes the data. Since early input is registered first, it drains all + // keypresses (including arrow keys / Enter) before Ink can see them, making + // dialogs like TrustDialog completely unresponsive to keyboard input. + stopCapturingEarlyInput() + if ( "production" === 'test' || isEnvTruthy(false) ||