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:
Eric Traut
2026-10-06 16:41:53 +00:00
committed by copyberry
parent ccde2fc8b7
commit ff9ab4aed9
5 changed files with 46 additions and 1 deletions
@@ -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(),