[PR #12260] [MERGED] Add a keyboard shortcut handler to the TabRowControl #28933

Open
opened 2026-01-31 09:31:44 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/12260
Author: @zadjii-msft
Created: 1/26/2022
Status: Merged
Merged: 1/26/2022
Merged by: @undefined

Base: mainHead: dev/migrie/b/8480-rebase


📝 Commits (5)

  • b00988d I don't think I need the TerminalPage.xaml change here, but the TabBase one feels unnecessarily hacky. That being said, there's no non-hack solution to this one.
  • 044f176 Merge remote-tracking branch 'origin/main' into dev/migrie/b/8480-rebase
  • 136a14a Merge remote-tracking branch 'origin/main' into dev/migrie/b/8480-rebase
  • 5d4ac21 I think this is a simpler solution, at least for #8480's sake
  • 5b4b641 cleanup

📊 Changes

3 files changed (+9 additions, -1 deletions)

View changed files

📝 src/cascadia/TerminalApp/TabBase.cpp (+1 -0)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+6 -0)
📝 src/cascadia/TerminalApp/TerminalPage.xaml (+2 -1)

📄 Description

This makes the scenario mentioned in #8480 work. It's maybe not as holistic a solution as we'd like, but it definitely works.

Tested both with Narrator, and using the TabView scroll handles to get tab focus into the tab row manually

  • Closing the active tab with Ctrl+Shift+w works (not the TabViewItem that has focus, but that's how Edgium works so that seems fine)
  • Opening a tab with Ctrl+Shift+t works
  • Opening the cmdpal with Ctrl+Shift+p works
  • Will take care of #8480 once we get the a11y team to validate
  • I work here

Notes:

None of

PreviewKeyDown="_KeyDownHandler"
KeyDown="_KeyDownHandler"
KeyUp="_KeyDownHandler"

On the TerminalPage directly seem to fire when the focus is in the TabViewItem or the New Tab flyout. But they fire just fine when focus is in the TermControl. Interesting, because you'd think that the TermControl would have already handled the key...


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/12260 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 1/26/2022 **Status:** ✅ Merged **Merged:** 1/26/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/b/8480-rebase` --- ### 📝 Commits (5) - [`b00988d`](https://github.com/microsoft/terminal/commit/b00988d9c255a77c022959b2f055ab72ef811d6d) I don't think I need the TerminalPage.xaml change here, but the TabBase one feels unnecessarily hacky. That being said, there's no non-hack solution to this one. - [`044f176`](https://github.com/microsoft/terminal/commit/044f1764a4ba581b6a3b078734d1e1a9f53c062c) Merge remote-tracking branch 'origin/main' into dev/migrie/b/8480-rebase - [`136a14a`](https://github.com/microsoft/terminal/commit/136a14a03333eef37ad86b035b137f72c8230f6b) Merge remote-tracking branch 'origin/main' into dev/migrie/b/8480-rebase - [`5d4ac21`](https://github.com/microsoft/terminal/commit/5d4ac219985506c9bd86ed393516dcdee4940134) I think this is a simpler solution, at least for #8480's sake - [`5b4b641`](https://github.com/microsoft/terminal/commit/5b4b6419838622d3f3fcd059cd4c077b40481a13) cleanup ### 📊 Changes **3 files changed** (+9 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/TabBase.cpp` (+1 -0) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+6 -0) 📝 `src/cascadia/TerminalApp/TerminalPage.xaml` (+2 -1) </details> ### 📄 Description This makes the scenario mentioned in #8480 work. It's maybe not as holistic a solution as we'd like, but it definitely works. Tested both with Narrator, and using the TabView scroll handles to get tab focus into the tab row manually * [x] Closing the _active_ tab with <kbd>Ctrl+Shift+w</kbd> works (not the `TabViewItem` that has focus, but that's how Edgium works so that seems fine) * [x] Opening a tab with <kbd>Ctrl+Shift+t</kbd> works * [x] Opening the cmdpal with <kbd>Ctrl+Shift+p</kbd> works * [x] Will take care of #8480 once we get the a11y team to validate * [x] I work here #### Notes: None of ```xaml PreviewKeyDown="_KeyDownHandler" KeyDown="_KeyDownHandler" KeyUp="_KeyDownHandler" ``` On the TerminalPage directly seem to fire when the focus is in the `TabViewItem` or the New Tab flyout. But they fire just fine when focus is in the `TermControl`. Interesting, because you'd think that the `TermControl` would have already handled the key... --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:31:44 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28933