-
Notifications
You must be signed in to change notification settings - Fork 9k
fix(tui): increase paste burst char interval on Windows to 30ms #9348
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
Changes from all commits
b72fc2f
01dbc75
c3fb071
945df7b
1012b37
a0f7c23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -151,10 +151,18 @@ use std::time::Instant; | |
| // Heuristic thresholds for detecting paste-like input bursts. | ||
| // Detect quickly to avoid showing typed prefix before paste is recognized | ||
| 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); | ||
| // Slower paste burts have been observed in windows environments, but ideally | ||
| // we want to keep this low | ||
|
|
||
| // Maximum delay between consecutive chars to be considered part of a paste burst. | ||
| // 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); | ||
| #[cfg(windows)] | ||
| const PASTE_BURST_CHAR_INTERVAL: Duration = Duration::from_millis(30); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that this is probably right on the threshold where we might from time to time detect actual typing as a paste for very fast typers typing common digraphs like 'th', 'er' etc. https://chatgpt.com/share/e/698b7f8e-4c10-8009-aa40-5e421aace79f Not a blocker - just a note for if we do need to update this down a bit - 25ms would be a good target point (unless there's data to suggest that the pastes are taking this long on your system) If it becomes a bigger issue then we'd want this to be runtime configurable, but we can hold off on that for now. |
||
|
|
||
| // Idle timeout before flushing buffered paste content. | ||
| // Slower paste bursts have been observed in Windows environments. | ||
| #[cfg(not(windows))] | ||
| const PASTE_BURST_ACTIVE_IDLE_TIMEOUT: Duration = Duration::from_millis(8); | ||
| #[cfg(windows)] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.