From eb347b17e32614144a1b16d1ee6e43fdcdc83786 Mon Sep 17 00:00:00 2001 From: khvitaly Date: Fri, 26 Mar 2021 22:43:19 +0300 Subject: [PATCH 1/2] Prevent arrow keys from dismissing tab renamer --- src/cascadia/TerminalApp/TabHeaderControl.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/cascadia/TerminalApp/TabHeaderControl.cpp b/src/cascadia/TerminalApp/TabHeaderControl.cpp index 37045dcb0dc..0049b1cf97e 100644 --- a/src/cascadia/TerminalApp/TabHeaderControl.cpp +++ b/src/cascadia/TerminalApp/TabHeaderControl.cpp @@ -18,8 +18,18 @@ namespace winrt::TerminalApp::implementation // We'll only process the KeyUp event if we received an initial KeyDown event first. // Avoids issue immediately closing the tab rename when we see the enter KeyUp event that was // sent to the command palette to trigger the openTabRenamer action in the first place. - HeaderRenamerTextBox().KeyDown([&](auto&&, auto&&) { + HeaderRenamerTextBox().KeyDown([&](auto&&, auto e) { _receivedKeyDown = true; + + // GH#9632 - mark navigation buttons as handled. + // This should prevent the tab view to use this key for navigation between tabs + if (e.OriginalKey() == Windows::System::VirtualKey::Down || + e.OriginalKey() == Windows::System::VirtualKey::Up || + e.OriginalKey() == Windows::System::VirtualKey::Left || + e.OriginalKey() == Windows::System::VirtualKey::Right) + { + e.Handled(true); + } }); // NOTE: (Preview)KeyDown does not work here. If you use that, we'll From 6b3319a9528c2b4f5fb27be46090805caaa3e9bc Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Mon, 29 Mar 2021 10:00:14 -0700 Subject: [PATCH 2/2] Update src/cascadia/TerminalApp/TabHeaderControl.cpp --- src/cascadia/TerminalApp/TabHeaderControl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cascadia/TerminalApp/TabHeaderControl.cpp b/src/cascadia/TerminalApp/TabHeaderControl.cpp index 0049b1cf97e..47cb16ba298 100644 --- a/src/cascadia/TerminalApp/TabHeaderControl.cpp +++ b/src/cascadia/TerminalApp/TabHeaderControl.cpp @@ -18,7 +18,7 @@ namespace winrt::TerminalApp::implementation // We'll only process the KeyUp event if we received an initial KeyDown event first. // Avoids issue immediately closing the tab rename when we see the enter KeyUp event that was // sent to the command palette to trigger the openTabRenamer action in the first place. - HeaderRenamerTextBox().KeyDown([&](auto&&, auto e) { + HeaderRenamerTextBox().KeyDown([&](auto&&, auto&& e) { _receivedKeyDown = true; // GH#9632 - mark navigation buttons as handled.