[PR #6290] [CLOSED] When the tab receives focus, immediately move focus to the active control #26621

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/6290
Author: @zadjii-msft
Created: 6/1/2020
Status: Closed

Base: mainHead: dev/migrie/b/moving-focus-is-hard


📝 Commits (2)

  • aa2fe26 Try moving focus to the control when the tab itself gains focus. This doesn't work when the unfocused tab is renamed, and might do weird things with accessibility
  • 548dd0e This is better

📊 Changes

3 files changed (+38 additions, -0 deletions)

View changed files

📝 src/cascadia/TerminalApp/Tab.cpp (+26 -0)
📝 src/cascadia/TerminalApp/Tab.h (+1 -0)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+11 -0)

📄 Description

I'm mostly just putting the PR out there for comments. I'm worried that this might have horrifying unintentional side-effects for accessibility, which I'm not loving.

This PR makes the Tab immediately toss focus to the active control, whenever the Tab receives focus, for any reason.

  • Left-click on the tab to focus the window? Focus the control. #3609
  • Close the color picker? Focus the control.
  • Hit esc to dismiss the menuflyout from the New Tab menu, the tab context menu? Focus the control. #5750
  • Hit esc to dismiss the tab rename? Focus the control.

@carlos-zamora will this horribly break accessibility?

My other theory here is to pre-emptively prevent the tab from receiving focus. That would probably involve

  • Focusing the control when a tab is left clicked
  • Manually passing focus to the control when any flyout is closed
  • Manually passing focus to the control when the color picker is closed
  • Manually passing focus to the control when the tab renamer is dismissed
  • Manually passing focus to the control when the command palette is closed
  • Manually passing focus to the control when <any future UI> is closed

So that might not scale as well, but that might be the more correct solution.


🔄 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/6290 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 6/1/2020 **Status:** ❌ Closed **Base:** `main` ← **Head:** `dev/migrie/b/moving-focus-is-hard` --- ### 📝 Commits (2) - [`aa2fe26`](https://github.com/microsoft/terminal/commit/aa2fe262a194c8946d2434bdae74edb7a256eaf9) Try moving focus to the control when the tab itself gains focus. This doesn't work when the unfocused tab is renamed, and might do weird things with accessibility - [`548dd0e`](https://github.com/microsoft/terminal/commit/548dd0ea92c0824fb2b2b29e4214654fdd1ac6f6) This is better ### 📊 Changes **3 files changed** (+38 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/Tab.cpp` (+26 -0) 📝 `src/cascadia/TerminalApp/Tab.h` (+1 -0) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+11 -0) </details> ### 📄 Description I'm mostly just putting the PR out there for comments. I'm worried that this might have horrifying unintentional side-effects for accessibility, which I'm not loving. This PR makes the `Tab` immediately toss focus to the active control, whenever the `Tab` receives focus, for any reason. * Left-click on the tab to focus the window? Focus the control. #3609 * Close the color picker? Focus the control. * Hit esc to dismiss the menuflyout from the New Tab menu, the tab context menu? Focus the control. #5750 * Hit esc to dismiss the tab rename? Focus the control. @carlos-zamora will this horribly break accessibility? My other theory here is to pre-emptively prevent the tab from receiving focus. That would probably involve * Focusing the control when a tab is left clicked * Manually passing focus to the control when any flyout is closed * Manually passing focus to the control when the color picker is closed * Manually passing focus to the control when the tab renamer is dismissed * Manually passing focus to the control when the command palette is closed * Manually passing focus to the control when \<any future UI> is closed So that might not scale as well, but that might be the more _correct_ solution. * [x] I work here * [ ] This is UI so it doesn't have tests * [x] Closes #3609 * [x] Closes #5750 --- <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:17:11 +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#26621