[PR #11040] [MERGED] Only attempt to focus if there is a control to focus #28365

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/11040
Author: @Rosefield
Created: 8/25/2021
Status: Merged
Merged: 8/25/2021
Merged by: @undefined

Base: mainHead: bug/gh11037-mp-crash


📝 Commits (1)

  • e6a3b50 Only attempt to focus if there is a control to focus

📊 Changes

1 file changed (+4 additions, -1 deletions)

View changed files

📝 src/cascadia/TerminalApp/TerminalPage.cpp (+4 -1)

📄 Description

Only focus if there is a control to focus (which may be null if e.g. the focused tab is being destroyed)

Closes #11037

Additional comments

I tried to remove the _activePane = nullptr in TerminalTab::DetachPane but that actually completely broke being able to focus the control at all making the tab completely unusable. Focus does seem to transfer just fine here with this change.

Validation Steps Performed

Used the command execution to move panes to and from existing panes, including new tabs and destroying tabs.


🔄 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/11040 **Author:** [@Rosefield](https://github.com/Rosefield) **Created:** 8/25/2021 **Status:** ✅ Merged **Merged:** 8/25/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `bug/gh11037-mp-crash` --- ### 📝 Commits (1) - [`e6a3b50`](https://github.com/microsoft/terminal/commit/e6a3b50f0a7640acf7c68229e1a956eb9733cdaf) Only attempt to focus if there is a control to focus ### 📊 Changes **1 file changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+4 -1) </details> ### 📄 Description Only focus if there is a control to focus (which may be null if e.g. the focused tab is being destroyed) Closes #11037 ## Additional comments I tried to remove the _activePane = nullptr in `TerminalTab::DetachPane` but that actually completely broke being able to focus the control at all making the tab completely unusable. Focus does seem to transfer just fine here with this change. ## Validation Steps Performed Used the command execution to move panes to and from existing panes, including new tabs and destroying tabs. --- <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:28:02 +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#28365