From 2e92a15464929401bf10f94d7ca5ebce62dc0a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89l=C3=A9a=20Dufresne?= <74742695+eleadufresne@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:22:04 -0500 Subject: [PATCH] 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 --- src/cascadia/TerminalApp/CommandPalette.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cascadia/TerminalApp/CommandPalette.cpp b/src/cascadia/TerminalApp/CommandPalette.cpp index 4817cd5242..bcee25c72d 100644 --- a/src/cascadia/TerminalApp/CommandPalette.cpp +++ b/src/cascadia/TerminalApp/CommandPalette.cpp @@ -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);