Support Ctrl+Insert for copying TUI selections (#50215)

## Why

Windows Terminal forwards `Ctrl+Insert` when its Copy action has no native terminal selection. Recognize this shortcut so it can copy text selected within Codex.

## What changed

Add `Ctrl+Insert` to the shared copy-key detection used by transcript and composer selections. Use the same detection for transcript input ownership so the selection consumes the shortcut before other input handlers.

## Testing

Extend transcript tests to verify `Ctrl+Insert` input ownership and copying. Extend composer tests and snapshots to verify that failed or unconfirmed copies preserve the selection, while confirmed copies clear it without changing the draft or cursor.

GitOrigin-RevId: 5a33c72cff4c4395511779a7051fc92f8bd5e5d7
This commit is contained in:
Eric Traut
2026-10-02 07:21:07 +00:00
committed by copyberry
parent 4dd51f4a5f
commit d64360f628
4 changed files with 26 additions and 12 deletions
+1 -4
View File
@@ -136,10 +136,7 @@ impl TranscriptView {
return true;
}
if self.selection.is_some() {
return (code == KeyCode::Char('c')
&& matches!(modifiers, KeyModifiers::CONTROL | KeyModifiers::SUPER))
|| (code == KeyCode::Char('c')
&& modifiers == (KeyModifiers::CONTROL | KeyModifiers::SHIFT))
return crate::text_selection::is_copy_key(key)
|| code == KeyCode::Esc
|| (code == KeyCode::Enter && modifiers == KeyModifiers::NONE)
|| (matches!(modifiers, KeyModifiers::NONE | KeyModifiers::SHIFT)