Skip to content

fix(tui): use shared paste burst interval on Windows#18914

Merged
fcoury-oai merged 2 commits into
mainfrom
fcoury/windows-paste-burst-shared-interval
May 4, 2026
Merged

fix(tui): use shared paste burst interval on Windows#18914
fcoury-oai merged 2 commits into
mainfrom
fcoury/windows-paste-burst-shared-interval

Conversation

@fcoury-oai

@fcoury-oai fcoury-oai commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #11678 by removing the Windows-specific PASTE_BURST_CHAR_INTERVAL override. Windows now uses the same 8ms paste-burst character interval as macOS and Linux, which removes the extra per-character hold that made fast typing and key repeat feel delayed on Windows.

The paste-burst heuristic itself is unchanged, and the Windows-specific active idle timeout remains in place. This PR only restores the shared character-to-character burst threshold that decides whether adjacent plain character events are part of a paste.

Motivation

PR #9348 raised the Windows character interval from 8ms to 30ms to protect the multiline paste behavior tracked in #2137, where pasted newlines could be interpreted as submits in Windows terminals. That fixed the paste failure, but it also made ordinary typing visibly laggy because the TUI waits briefly before flushing a single typed character while it checks whether a paste burst is forming.

The deployed behavior here is to remove that Windows-only delay and return to the cross-platform threshold. Manual Windows validation of the critical VS Code integrated terminal path shows multiline paste still works with the final 8ms value, including testing on VS Code 1.107.0.

Testing

  • cargo test -p codex-tui
  • Manual Windows validation in VS Code integrated PowerShell with the final 8ms interval

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

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: fe37f770bf

ℹ️ 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 events
// more slowly than native terminals, so we use a higher threshold there.
#[cfg(not(windows))]
const PASTE_BURST_CHAR_INTERVAL: Duration = Duration::from_millis(8);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Badge Reinstate Windows-specific burst interval fallback

Using a single 8ms PASTE_BURST_CHAR_INTERVAL on Windows can reintroduce split/auto-submitted multiline pastes on slower terminal paths. In note_plain_char, gaps above this value reset consecutive_plain_char_burst, so burst mode never activates and Enter suppression may not apply. This regresses the prior Windows safety behavior for environments that still deliver paste chars with >8ms jitter.

Useful? React with 👍 / 👎.

@fcoury-oai fcoury-oai merged commit 36912ce into main May 4, 2026
26 checks passed
@fcoury-oai fcoury-oai deleted the fcoury/windows-paste-burst-shared-interval branch May 4, 2026 20:39
@github-actions github-actions Bot locked and limited conversation to collaborators May 4, 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.

Typing on the CLI since 0.100 is very slow

2 participants