mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Suppress repeated image paste presses in legacy terminals (#51411)
## Why Legacy terminals report key auto-repeat as new presses, which can trigger repeated image pastes when presses accumulate during a slow paste. ## What changed Suppress repeated `Ctrl+V` and `Alt+V` image paste presses within a sliding 250 ms window, refreshed after each suppressed press and after a paste completes. Clear suppression on other ordinary key presses or key release events so a fresh paste can proceed immediately. ## Testing Add regression coverage for repeated presses, window expiry, and resetting suppression on another key press or a key release. Update the shortcut remapping test to release the key between image pastes. GitOrigin-RevId: 45abc056e5bda47d1c9704702e369e63dcce29db
This commit is contained in:
@@ -179,6 +179,7 @@ impl ChatWidget {
|
||||
plan_stream_controller: None,
|
||||
pending_stream_consolidations: 0,
|
||||
pending_clipboard: None,
|
||||
suppress_image_paste_until: Instant::now(),
|
||||
copy_last_response_binding,
|
||||
running_commands: HashMap::new(),
|
||||
collab_agent_metadata: HashMap::new(),
|
||||
|
||||
Reference in New Issue
Block a user