[PR #10048] In specific scenarios, focus the active control #27870

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

Original Pull Request: https://github.com/microsoft/terminal/pull/10048

State: closed
Merged: Yes


A redo of #6290. That PR was overkill. In that one, we'd toss focus back to the active control any time that the tab view item got focus. That's maybe not the best solution.

Instead, this PR is precision strikes. We're re-using a lot of what we already have from #9260.

  • When the context menu is closed, yeet focus to the control.
  • When the renamer is dismissed, yeet focus to the control.
  • When the TabViewItem is tapped (meaning no one else handled it), yeet focus to the control.

checklist

scenarios:

  • focus the window by clicking on the tab -> Control is focused.
  • Open the color picker with the context menu, can move the focus inside the picker with the arrow keys.
  • Dismiss the picker with esc -> Control is focused.
  • Dismiss the picker with enter -> Control is focused.
  • Dismiss the renamer with esc -> Control is focused.
  • Dismiss the renamer with enter -> Control is focused.
  • Dismiss the context menu with esc -> Control is focused.
  • Start renaming, then click on the tab -> Rename is committed, Control is focused.
  • Start renaming, then click on the text box -> focus is still in the text box
**Original Pull Request:** https://github.com/microsoft/terminal/pull/10048 **State:** closed **Merged:** Yes --- A redo of #6290. That PR was overkill. In that one, we'd toss focus back to the active control any time that the tab view item got focus. That's maybe not the _best_ solution. Instead, this PR is precision strikes. We're re-using a lot of what we already have from #9260. * When the context menu is closed, yeet focus to the control. * When the renamer is dismissed, yeet focus to the control. * When the TabViewItem is tapped (meaning no one else handled it), yeet focus to the control. ### checklist * [x] I work here * [ ] This is UI so it doesn't have tests * [x] Closes #3609 * [x] Closes #5750 * [x] Closes #6680 ### scenarios: * [x] focus the window by clicking on the tab -> Control is focused. * [x] Open the color picker with the context menu, can move the focus inside the picker with the arrow keys. * [x] Dismiss the picker with esc -> Control is focused. * [x] Dismiss the picker with enter -> Control is focused. * [x] Dismiss the renamer with esc -> Control is focused. * [x] Dismiss the renamer with enter -> Control is focused. * [x] Dismiss the context menu with esc -> Control is focused. * [x] Start renaming, then click on the tab -> Rename is committed, Control is focused. * [x] Start renaming, then click on the text box -> focus is still in the text box
claunia added the pull-request label 2026-01-31 09:24:48 +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#27870