[PR #9028] [MERGED] Fix crash when closing multiple splits from the tab context menu #27393

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/9028
Author: @PankajBhojwani
Created: 2/4/2021
Status: Merged
Merged: 2/4/2021
Merged by: @undefined

Base: mainHead: dev/pabhoj/id_fix


📝 Commits (4)

📊 Changes

3 files changed (+24 additions, -12 deletions)

View changed files

📝 src/cascadia/TerminalApp/Pane.cpp (+2 -2)
📝 src/cascadia/TerminalApp/Pane.h (+1 -1)
📝 src/cascadia/TerminalApp/TerminalTab.cpp (+21 -9)

📄 Description

Summary of the Pull Request

Fix for #9021

Turns out that what was happening is that the parent pane's Closed event was being caught by the tab, and parent panes always have nullopt as their id. So now the Pane::Id() call always returns an optional, allowing us to check if it has a value before we access it.

PR Checklist

Validation Steps Performed

No more crash


🔄 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/9028 **Author:** [@PankajBhojwani](https://github.com/PankajBhojwani) **Created:** 2/4/2021 **Status:** ✅ Merged **Merged:** 2/4/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/pabhoj/id_fix` --- ### 📝 Commits (4) - [`20688cd`](https://github.com/microsoft/terminal/commit/20688cd98a45110a529f4f9884c0f0117aef0b86) pane id fix - [`fce36d3`](https://github.com/microsoft/terminal/commit/fce36d39f0c2ec9410cf62603ebfa231aa586b2f) compare directly - [`f0aa00d`](https://github.com/microsoft/terminal/commit/f0aa00db201215e68c73ead3946d4c4b49ca14da) Merge branch 'main' of https://github.com/microsoft/terminal into dev/pabhoj/id_fix - [`42a63aa`](https://github.com/microsoft/terminal/commit/42a63aae31802e7aefdb0a5933c8f3a29d8d369b) check value other cases ### 📊 Changes **3 files changed** (+24 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/Pane.cpp` (+2 -2) 📝 `src/cascadia/TerminalApp/Pane.h` (+1 -1) 📝 `src/cascadia/TerminalApp/TerminalTab.cpp` (+21 -9) </details> ### 📄 Description ## Summary of the Pull Request Fix for #9021 Turns out that what was happening is that the _parent_ pane's `Closed` event was being caught by the tab, and parent panes always have `nullopt` as their id. So now the `Pane::Id()` call always returns an optional, allowing us to check if it has a value before we access it. ## PR Checklist * [x] Closes #9021 ## Validation Steps Performed No more crash --- <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:21:42 +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#27393