Fix Ctrl+Insert does not copy the selected text from Command Palette (#18483)

Fixes an issue where pressing `CTRL` + `Insert` does not copy text
selected in the Command Palette. Instead, it closes it, and any text
selected in the pane is copied to the clipboard.

Since `Insert` is a virtual key, I address the issue by adding a
conditional check for `CTRL` with either `Insert` or `C` (previously, it
only checked for `CTRL` with `C`) for the copy action in the Command
Palette.

## Validation Steps Performed

I followed the reproduction steps and verified that the actual behaviour
matched the expected behaviour. All existing tests passed, but no new
test was added.

Closes #9520
This commit is contained in:
Éléa Dufresne 2025-02-03 15:22:04 -05:00 committed by GitHub
parent aafbd17f3d
commit 2e92a15464
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -359,7 +359,7 @@ namespace winrt::TerminalApp::implementation
_switchToMode(CommandPaletteMode::CommandlineMode);
e.Handled(true);
}
else if (key == VirtualKey::C && ctrlDown)
else if ((key == VirtualKey::C || key == VirtualKey::Insert) && ctrlDown)
{
_searchBox().CopySelectionToClipboard();
e.Handled(true);