Priority: P2
Category: performance, ui
Parent: #3011
Problem / 问题
User keystrokes typed during REPL initialization (200-500ms) are lost. Users must wait for the prompt to appear before typing.
REPL 初始化期间(200-500ms)用户输入丢失,必须等待提示符出现后才能输入。
Proposed Solution / 方案
- Add
packages/cli/src/utils/earlyInput.ts:
startCapturingEarlyInput(): enables raw stdin buffering
drainEarlyInput(): returns buffered input and stops capturing
- Call
startCapturingEarlyInput() at the very beginning of main() (before any async work)
- Pass buffered input to REPL on render
Reference: Claude Code src/utils/earlyInput.ts — same pattern.
Acceptance Criteria / 验收标准
Problem / 问题
User keystrokes typed during REPL initialization (200-500ms) are lost. Users must wait for the prompt to appear before typing.
REPL 初始化期间(200-500ms)用户输入丢失,必须等待提示符出现后才能输入。
Proposed Solution / 方案
packages/cli/src/utils/earlyInput.ts:startCapturingEarlyInput(): enables raw stdin bufferingdrainEarlyInput(): returns buffered input and stops capturingstartCapturingEarlyInput()at the very beginning ofmain()(before any async work)Reference: Claude Code
src/utils/earlyInput.ts— same pattern.Acceptance Criteria / 验收标准