Skip to content

Conversation

@yuvrajangadsingh
Copy link
Contributor

Summary

  • Increases PASTE_BURST_CHAR_INTERVAL from 8ms to 30ms on Windows to fix multi-line paste issues in VS Code integrated terminal
  • Follows existing pattern of platform-specific timing (like PASTE_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_INTERVAL threshold 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 for PASTE_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

  • All existing paste_burst tests pass
  • Test multi-line paste in VS Code integrated PowerShell on Windows
  • Test multi-line paste in standalone Windows PowerShell
  • Verify no regression on macOS/Linux

Fixes #2137

@etraut-openai
Copy link
Collaborator

@codex review

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@yuvrajangadsingh yuvrajangadsingh force-pushed the fix/windows-paste-burst-timing branch from f39d1fa to a2a64f2 Compare January 16, 2026 11:25
@yuvrajangadsingh
Copy link
Contributor Author

Addressed the review feedback:

Fix: Applied the same Windows-specific timing to tui2/src/bottom_pane/paste_burst.rs to keep both UIs aligned per the guidelines in AGENTS.md.

Now both tui and tui2 have:

  • PASTE_BURST_CHAR_INTERVAL: 8ms (Unix) / 30ms (Windows)

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Hooray!

ℹ️ 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".

@yuvrajangadsingh yuvrajangadsingh force-pushed the fix/windows-paste-burst-timing branch 2 times, most recently from 840a379 to 9a6853e Compare January 22, 2026 14:56
@yuvrajangadsingh
Copy link
Contributor Author

Rebased on latest main - tui2 paste_burst.rs was removed upstream, so changes now only apply to tui.

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. 🚀

ℹ️ 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".

@etraut-openai
Copy link
Collaborator

@yuvrajangadsingh, looks like there are some merge conflicts that need to be resolved.

@yuvrajangadsingh yuvrajangadsingh force-pushed the fix/windows-paste-burst-timing branch from db61009 to 6129831 Compare January 28, 2026 15:32
@yuvrajangadsingh
Copy link
Contributor Author

Rebased on latest main. Conflicts resolved.

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ 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".

@yuvrajangadsingh
Copy link
Contributor Author

@etraut-openai Conflicts resolved, rebased on latest main. CI passing, Codex review clean. Ready for review.

@yuvrajangadsingh
Copy link
Contributor Author

Gentle ping - users are waiting for this fix. See #2137 (comment)

The PR is rebased and ready for review.

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
@yuvrajangadsingh yuvrajangadsingh force-pushed the fix/windows-paste-burst-timing branch from a1259fc to b72fc2f Compare February 5, 2026 07:53
@joshka-oai joshka-oai self-assigned this Feb 10, 2026
Copy link
Collaborator

@joshka-oai joshka-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and apologies for the delay in getting it over the line and the churn getting there.

#[cfg(not(windows))]
const PASTE_BURST_CHAR_INTERVAL: Duration = Duration::from_millis(8);
#[cfg(windows)]
const PASTE_BURST_CHAR_INTERVAL: Duration = Duration::from_millis(30);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this is probably right on the threshold where we might from time to time detect actual typing as a paste for very fast typers typing common digraphs like 'th', 'er' etc. https://chatgpt.com/share/e/698b7f8e-4c10-8009-aa40-5e421aace79f

Not a blocker - just a note for if we do need to update this down a bit - 25ms would be a good target point (unless there's data to suggest that the pastes are taking this long on your system) If it becomes a bigger issue then we'd want this to be runtime configurable, but we can hold off on that for now.

@joshka-oai joshka-oai enabled auto-merge (squash) February 10, 2026 19:31
@joshka-oai
Copy link
Collaborator

Working out the bazel problems with this so we can merge it.

@etraut-openai
Copy link
Collaborator

@joshka-oai, we can ignore the bazel issues. Those actions will always fail for external contributions. I'll override and merge.

@etraut-openai etraut-openai merged commit b4ffb2e into openai:main Feb 11, 2026
43 of 52 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pasting multi-line text in Codex CIL only keeps first line and auto-submits on Windows

3 participants