mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user