Skip to content

fix(cli): preserve startup input through full init#94

Open
BingqingLyu wants to merge 8 commits into
mainfrom
fork-pr-3242-codex-early-input-capture-3224
Open

fix(cli): preserve startup input through full init#94
BingqingLyu wants to merge 8 commits into
mainfrom
fork-pr-3242-codex-early-input-capture-3224

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • capture TTY input at the start of CLI startup so early keystrokes are not dropped
  • replay buffered startup input through KeypressProvider once the interactive UI mounts
  • add regression tests for startup wiring, keypress replay, and the early input utility

Why

Fixes QwenLM#3224.

Today, fast typists can lose input while the interactive REPL is still initializing. This change preserves those keystrokes and replays them into the normal input pipeline once the prompt is ready.

Testing

  • cd packages/cli && npx vitest run src/utils/earlyInput.test.ts src/ui/contexts/KeypressContext.replay.test.tsx src/gemini.test.tsx
  • npm run build
  • npm run typecheck

Demo

before
https://github.com/user-attachments/assets/461abf53-e732-4e8f-b77a-03d1e863c22c

after
https://github.com/user-attachments/assets/ec7e6472-66a6-4ddc-9359-0d9f73837657

@BingqingLyu

BingqingLyu commented May 7, 2026

Copy link
Copy Markdown
Owner Author

Conflict Group 1

This PR shares modified functions with 16 other PR(s): #10, #11, #112, #113, #114, #117, #14, #17, #20, #26, #31, #37, #6, #7, #87, #88.

These PRs should be reviewed as a batch — merging one may affect the others.

Function File Also modified by
KeypressProvider KeypressContext.tsx #37, #87
main gemini.tsx #14, #17, #20
relaunchAppInChildProcess relaunch.ts #11
startInteractiveUI gemini.tsx #114, #117, #14, #17, #31, #6, #88
start_sandbox sandbox.ts #10, #112, #113, #114, #117, #26, #7, #88
graph LR
    PR94["PR #94"]
    FKeypressProvider_396["KeypressProvider<br>KeypressContext.tsx"]
    PR94 -->|modifies| FKeypressProvider_396
    PR37["PR #37"]
    PR37 -->|modifies| FKeypressProvider_396
    PR87["PR #87"]
    PR87 -->|modifies| FKeypressProvider_396
    Fmain_4875["main<br>gemini.tsx"]
    PR94 -->|modifies| Fmain_4875
    PR14["PR #14"]
    PR14 -->|modifies| Fmain_4875
    PR17["PR #17"]
    PR17 -->|modifies| Fmain_4875
    PR20["PR #20"]
    PR20 -->|modifies| Fmain_4875
    FrelaunchAppInChildProcess_6506["relaunchAppInChildProcess<br>relaunch.ts"]
    PR94 -->|modifies| FrelaunchAppInChildProcess_6506
    PR11["PR #11"]
    PR11 -->|modifies| FrelaunchAppInChildProcess_6506
    FstartInteractiveUI_4875["startInteractiveUI<br>gemini.tsx"]
    PR94 -->|modifies| FstartInteractiveUI_4875
    PR114["PR #114"]
    PR114 -->|modifies| FstartInteractiveUI_4875
    PR117["PR #117"]
    PR117 -->|modifies| FstartInteractiveUI_4875
    PR14 -->|modifies| FstartInteractiveUI_4875
    PR17 -->|modifies| FstartInteractiveUI_4875
    PR31["PR #31"]
    PR31 -->|modifies| FstartInteractiveUI_4875
    PR6["PR #6"]
    PR6 -->|modifies| FstartInteractiveUI_4875
    PR88["PR #88"]
    PR88 -->|modifies| FstartInteractiveUI_4875
    Fstart_sandbox_9815["start_sandbox<br>sandbox.ts"]
    PR94 -->|modifies| Fstart_sandbox_9815
    PR10["PR #10"]
    PR10 -->|modifies| Fstart_sandbox_9815
    PR112["PR #112"]
    PR112 -->|modifies| Fstart_sandbox_9815
    PR113["PR #113"]
    PR113 -->|modifies| Fstart_sandbox_9815
    PR114 -->|modifies| Fstart_sandbox_9815
    PR117 -->|modifies| Fstart_sandbox_9815
    PR26["PR #26"]
    PR26 -->|modifies| Fstart_sandbox_9815
    PR7["PR #7"]
    PR7 -->|modifies| Fstart_sandbox_9815
    PR88 -->|modifies| Fstart_sandbox_9815
Loading

Posted by codegraph-ai conflict detection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicting-group-1 Conflicting PR group 1 — review as a batch conflicting-pr Shares at least one cross-PR dependency with other PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2] Early input capture during REPL init / 启动期间用户输入捕获

2 participants