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

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

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

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

2 participants