You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Codex instant starts sometimes on pasting text #5172
On Windows the terminal normally ignores the bracketed‑paste mode that we request (tui/src/tui.rs:49), so pastes fall back to per‑character key events instead of the single Event::Paste path that handle_paste
expects.
When that happens our “paste burst” heuristic tries to detect a paste by watching how quickly characters arrive (tui/src/bottom_pane/paste_burst.rs:4-123). The threshold is only 8 ms between characters, and the
burst window closes after 120 ms. Windows consoles often deliver the characters—especially the trailing newline—more slowly than that, so the burst finishes before the newline shows up.
Once the burst has closed, the newline is treated as a real Enter keypress inside handle_key_event_without_popup (tui/src/bottom_pane/chat_composer.rs:906-972), which immediately submits the request. That
matches the behavior you’re seeing: pasting multi-line text sometimes triggers a send even though you didn’t press Enter.
Next Step Ideas
Relax the paste-burst timing on Windows (or detect the platform) so the newline still lands inside the burst window.
Add an option to disable “Enter submits” when the paste buffer just flushed, so stray newlines turn into literal newlines instead of submissions.
But most terminals support bracketed paste — I’ve checked it in various ways, and it seems the culprit is requery_default_colors() in tui.rs.
All observations and measurements are included in the PR above; I’ve described them in detail. I also conducted a more in-depth analysis, though I didn’t include everything in the description.
Activity
github-actions commentedon Oct 14, 2025
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
tibo-openai commentedon Oct 16, 2025
Codex analysis
• Likely Cause
expects.
burst window closes after 120 ms. Windows consoles often deliver the characters—especially the trailing newline—more slowly than that, so the burst finishes before the newline shows up.
matches the behavior you’re seeing: pasting multi-line text sometimes triggers a send even though you didn’t press Enter.
Next Step Ideas
dylan-hurd-oai commentedon Oct 18, 2025
Discussing a fix in #3371
adsqx commentedon Oct 22, 2025
But most terminals support bracketed paste — I’ve checked it in various ways, and it seems the culprit is
requery_default_colors()intui.rs.All observations and measurements are included in the PR above; I’ve described them in detail. I also conducted a more in-depth analysis, though I didn’t include everything in the description.
etraut-openai commentedon Nov 15, 2025
Closing in favor of #2137