-
Notifications
You must be signed in to change notification settings - Fork 7.3k
fix(tui): increase paste burst char interval on Windows to 30ms #9348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(tui): increase paste burst char interval on Windows to 30ms #9348
Conversation
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 51881cce7b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Windows terminals (especially VS Code integrated terminal) deliver paste key events more slowly than native terminals. The previous 8ms threshold caused paste detection to fail, resulting in Enter submitting the message instead of inserting a newline during multi-line pastes. This follows the existing pattern of Windows-specific timing for PASTE_BURST_ACTIVE_IDLE_TIMEOUT (60ms vs 8ms). Fixes openai#2137
f39d1fa to
a2a64f2
Compare
|
Addressed the review feedback: Fix: Applied the same Windows-specific timing to Now both
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
PASTE_BURST_CHAR_INTERVALfrom 8ms to 30ms on Windows to fix multi-line paste issues in VS Code integrated terminalPASTE_BURST_ACTIVE_IDLE_TIMEOUT)Problem
When pasting multi-line text in Codex CLI on Windows (especially VS Code integrated terminal), only the first portion is captured before auto-submit. The rest arrives as a separate message.
Root cause: VS Code's terminal emulation adds latency (~10-15ms per character) between key events. The 8ms
PASTE_BURST_CHAR_INTERVALthreshold is too tight - characters arrive slower than expected, so burst detection fails and Enter submits instead of inserting a newline.Solution
Use Windows-specific timing (30ms) for
PASTE_BURST_CHAR_INTERVAL, following the same pattern already used forPASTE_BURST_ACTIVE_IDLE_TIMEOUT(60ms on Windows vs 8ms on Unix).30ms is still fast enough to distinguish paste from typing (humans type ~200ms between keystrokes).
Test plan
Fixes #2137