From 80f107965d350c598a6e5c7db376234a4e6e156f Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 24 May 2019 16:43:46 -0500 Subject: [PATCH] Fix the bell sound when Alt+key is pressed. (#1006) --- src/cascadia/WindowsTerminal/IslandWindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cascadia/WindowsTerminal/IslandWindow.cpp b/src/cascadia/WindowsTerminal/IslandWindow.cpp index 9eda653b7..0d84c1f4b 100644 --- a/src/cascadia/WindowsTerminal/IslandWindow.cpp +++ b/src/cascadia/WindowsTerminal/IslandWindow.cpp @@ -162,6 +162,13 @@ LRESULT IslandWindow::MessageHandler(UINT const message, WPARAM const wparam, LP return 0; // eat the message } } + case WM_MENUCHAR: + { + // GH#891: return this LRESULT here to prevent the app from making a + // bell when alt+key is pressed. A menu is active and the user presses a + // key that does not correspond to any mnemonic or accelerator key, + return MAKELRESULT(0, MNC_CLOSE); + } } // TODO: handle messages here...