Skip to content

Conversation

@dylan-hurd-oai
Copy link
Collaborator

@dylan-hurd-oai dylan-hurd-oai commented Jan 6, 2026

Summary

This PR builds heavily on the work from @occurrent in #8021 - I've only added a small fix, added additional tests, and propagated the changes to tui2.

From the original PR:

On Windows, Codex relies on PasteBurst for paste detection because bracketed paste is not reliably available via crossterm.

When pasted content starts with non-ASCII characters, input is routed through handle_non_ascii_char, which bypasses the normal paste burst logic. This change extends the paste burst window for that path, which should ensure that Enter is correctly grouped as part of the paste.

Testing

  • tested locally cross-platform
  • added regression tests

@dylan-hurd-oai dylan-hurd-oai changed the title Fix windows paste fix: windows can now paste non-ascii multiline text Jan 6, 2026
@dylan-hurd-oai dylan-hurd-oai marked this pull request as ready for review January 7, 2026 18:44
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: 2617290692

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

}

#[test]
fn question_mark_does_not_toggle_during_paste_burst() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

exists in tui/chat_composer.rs, copying over

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.

LGTM

const PASTE_BURST_MIN_CHARS: u16 = 3;
const PASTE_BURST_CHAR_INTERVAL: Duration = Duration::from_millis(8);
const PASTE_ENTER_SUPPRESS_WINDOW: Duration = Duration::from_millis(120);
const PASTE_BURST_ACTIVE_IDLE_TIMEOUT: Duration = Duration::from_millis(60);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would be good to capture the reason for the differences in these intervals - are they based on testing / docs / ? Do we have more context on why we might increase or decrease? Are they likely to cause differences in operating systems / remote systems / multiplexers?

Maybe just something here that captures why we chose is enough and we can come back to the deeper questions.

Copy link
Contributor

Choose a reason for hiding this comment

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

In Windows, if we use an 8ms interval, copying long non-ASCII text might cause the Pasted Content Block to be split into multiple chunks, indicating that the paste burst was temporarily exited midway through the paste process. Sometimes, it might even cause line breaks to be recognized as commits. I'm not sure if there's a better way.

The following images show the results caused by two different delays.

8ms:
8ms

60ms:
60ms

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks - mostly I want a short summary in the code, so we know why / how to tweak it if needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @occurrent! I added a comment here and made this platform-specific

@dylan-hurd-oai
Copy link
Collaborator Author

dylan-hurd-oai commented Jan 8, 2026

@occurrent thanks again for your contribution here - we really appreciate the time you took to draft this change. I'll make sure you're credited in the next release notes for this PR

@dylan-hurd-oai dylan-hurd-oai merged commit 0f8bb45 into main Jan 8, 2026
26 checks passed
@dylan-hurd-oai dylan-hurd-oai deleted the fix-windows-paste branch January 8, 2026 07:21
@github-actions github-actions bot locked and limited conversation to collaborators Jan 8, 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.

4 participants