-
Notifications
You must be signed in to change notification settings - Fork 7.2k
fix: windows can now paste non-ascii multiline text #8021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
Hi @occurrent! Why close this? |
|
@andromarces I found original patch introduced non ascii path could mis handle multibyte input, which could lead to panics or incorrect behavior when handling multibyte characters. This should heve been fixed in the latest commit. |
|
@occurrent, can you clarify the latest status of this PR? Does your most recent commit address the incorrect behavior that you noted in your comment above? |
|
@etraut-openai Yes, the most recent commit fixes the incorrect behavior mentioned earlier. Separately, this patch may make non-ASCII input more likely to be classified as a paste block, which can expose an existing code path that does not fully handle non-ASCII input and may panic. Some of this is already being addressed in PR #8647, so I did not submit a separate fix. If this PR is merged, landing PR #8647 first would help. Aside from that, I am not aware of other panic paths introduced by this patch, though the behavior may still need some observation in practice. |
|
OK, thanks for the update. Very helpful. It looks like there are some test failures that need attention. |
## 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 - [x] tested locally cross-platform - [x] added regression tests --------- Co-authored-by: occur <[email protected]>
## 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 - [x] tested locally cross-platform - [x] added regression tests --------- Co-authored-by: occur <[email protected]>
|
#8774 has been merged, so I'm closing this PR. Thanks again for your work on this @occurrent. |
Fixes #2137
On Windows, Codex relies on
PasteBurstfor paste detection becausebracketed 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 burstlogic. This change extends the paste burst window for that path, which
should ensure that Enter is correctly grouped as part of the paste.
Adds a regression test:
non_ascii_start_extends_burst_window_for_enter