-
Notifications
You must be signed in to change notification settings - Fork 5.5k
burst paste edge cases #2683
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
burst paste edge cases #2683
Conversation
There was a problem hiding this 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 suggestions.
Reply with @codex fix comments
to fix any unresolved comments.
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, or 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 fix this CI failure" or "@codex address that feedback".
codex-rs/tui/src/bottom_pane/mod.rs
Outdated
if needs_redraw { | ||
self.request_redraw(); | ||
} | ||
if self.composer.is_in_paste_burst() { | ||
self.request_redraw_in( | ||
crate::bottom_pane::chat_composer::ChatComposer::recommended_paste_flush_delay( | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] Scheduled redraw may not flush paste burst
Key handling schedules a redraw after each char (bottom_pane/mod.rs:161‑169) expecting flush_paste_burst_if_due
(chat_composer.rs:142‑151) to run when enough time passes. But the frame scheduler only keeps the earliest deadline (tui.rs:202‑209), so later keystrokes can’t delay the draw. If the final char arrives shortly before that deadline, no further frame is queued and the buffered paste stays unflushed until another user event.
Useful? React with 👍 / 👎.
5eccf32
to
bb2fc9a
Compare
Should we have a config option to disable the paste burst logic just in case someone is using a terminal that doesn't play well with this logic so at least they have an escape hatch in this case? |
@bolinfest that's a good idea. is there a way of knowing we are on windows? we can only enable it by default to windows. |
there should be a way |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions and small comments to start.
I believe @dedrisian-oai said this was also applicable to the VS Code terminal? And using Codex CLI over ssh? |
assert_eq!(imgs, vec![tmp_path.clone()]); | ||
} | ||
|
||
#[test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice tests!
2199db9
to
b894d90
Compare
Just tested on a windows machine; works well! 👍 |
This PR fixes two edge cases in managing burst paste (mainly on power shell).
Bugs: