[PR #5809] [MERGED] Manually select a new tab when we're in fullscreen mode #26478

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/5809
Author: @zadjii-msft
Created: 5/8/2020
Status: Merged
Merged: 5/8/2020
Merged by: @DHowett-MSFT

Base: masterHead: dev/migrie/b/5799-accidentally-the-whole-thing


📝 Commits (1)

  • 0aced5a Manually select a new tab when we're in fullscreen mode

📊 Changes

1 file changed (+31 additions, -0 deletions)

View changed files

📝 src/cascadia/TerminalApp/TerminalPage.cpp (+31 -0)

📄 Description

Summary of the Pull Request

If we're fullscreen, the TabView isn't Visible. If it's not Visible, it's not going to raise a SelectionChanged event, which is what we usually use to focus another tab. Instead, we'll have to do it manually here.

So, what we're going to try to do is move the focus to the tab to the left, within the bounds of how many tabs we have.

EX: we have 4 tabs: [A, B, C, D]. If we close:

  • A (tabIndex=0): We'll want to focus tab B (now in index 0)
  • B (tabIndex=1): We'll want to focus tab A (now in index 0)
  • C (tabIndex=2): We'll want to focus tab B (now in index 1)
  • D (tabIndex=3): We'll want to focus tab C (now in index 2)

_UpdatedSelectedTab will do the work of setting up the new tab as the focused one, and unfocusing all the others.

Also, we need to manually set the SelectedItem of the tabView here. If we don't, then the TabView will technically not have a selected item at all, which can make things like ClosePane not work correctly.

References

PR Checklist

Validation Steps Performed

Played with it a bunch


🔄 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/5809 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 5/8/2020 **Status:** ✅ Merged **Merged:** 5/8/2020 **Merged by:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Base:** `master` ← **Head:** `dev/migrie/b/5799-accidentally-the-whole-thing` --- ### 📝 Commits (1) - [`0aced5a`](https://github.com/microsoft/terminal/commit/0aced5ac2db9796bfd6ec686d2a5957795dadd19) Manually select a new tab when we're in fullscreen mode ### 📊 Changes **1 file changed** (+31 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+31 -0) </details> ### 📄 Description ## Summary of the Pull Request If we're fullscreen, the TabView isn't `Visible`. If it's not `Visible`, it's _not_ going to raise a `SelectionChanged` event, which is what we usually use to focus another tab. Instead, we'll have to do it manually here. So, what we're going to try to do is move the focus to the tab to the left, within the bounds of how many tabs we have. EX: we have 4 tabs: [A, B, C, D]. If we close: * A (`tabIndex=0`): We'll want to focus tab B (now in index 0) * B (`tabIndex=1`): We'll want to focus tab A (now in index 0) * C (`tabIndex=2`): We'll want to focus tab B (now in index 1) * D (`tabIndex=3`): We'll want to focus tab C (now in index 2) `_UpdatedSelectedTab` will do the work of setting up the new tab as the focused one, and unfocusing all the others. Also, we need to _manually_ set the SelectedItem of the tabView here. If we don't, then the TabView will technically not have a selected item at all, which can make things like ClosePane not work correctly. ## References ## PR Checklist * [x] Closes #5799 * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated ## Validation Steps Performed Played with it a bunch --- <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:16:20 +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#26478