Skip to content

Commit

Permalink
Prevent arrow keys from dismissing tab renamer (#9633)
Browse files Browse the repository at this point in the history
## PR Checklist
* [x] Closes #9632
* [x] CLA signed. 
* [ ] Tests added/passed
* [ ] Documentation updated. 
* [ ] Schema updated.
* [ ] I've discussed this with core contributors already.
  • Loading branch information
Don-Vito committed Mar 29, 2021
1 parent 5a78566 commit 704836e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/cascadia/TerminalApp/TabHeaderControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 704836e

Please sign in to comment.