From 8043264ac65c3e8c7c92c0cfa229ad588794a94e Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Mon, 15 Jun 2020 10:17:16 -0500 Subject: [PATCH] Fix sending a NUL on alt key up --- src/cascadia/TerminalControl/TermControl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index 2a42a008ec0..a5da8debc7c 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -725,7 +725,9 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation { // Manually generate an Alt KeyUp event into the key bindings or terminal. // This is required as part of GH#6421. - (void)_TrySendKeyEvent(VK_MENU, 0, modifiers, false); + // GH#6513 - make sure to set the scancode too, otherwise conpty + // will think this is a NUL + (void)_TrySendKeyEvent(VK_MENU, LOWORD(MapVirtualKeyW(VK_MENU, MAPVK_VK_TO_VSC)), modifiers, false); handled = true; } else if (vkey == VK_F7 && down)