[PR #9571] [MERGED] Prevent tab context menu from closing root pane directly #27629

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/9571
Author: @Don-Vito
Created: 3/21/2021
Status: Merged
Merged: 3/22/2021
Merged by: @undefined

Base: mainHead: 9502-do-not-close-pane-from-tab


📝 Commits (1)

  • e16f243 Prevent tab context menu from closing root pane directly

📊 Changes

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

View changed files

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

📄 Description

Summary of the Pull Request

Currently a repeated attempt to close a read-only tab from context menu,
will bring the terminal into invalid state if user dismisses close action.

There are two root causes for this:

  1. The tab close menu triggers the closing of the root pane
    (rather than invoking close tab flow in the Terminal Page).
  2. Currently panes are not aware that the closing was canceled,
    and thus they trigger the Closed event, putting the system in a weird state,
    where the Closed handlers were invoked, but the Pane remains.

This PR mitigates #9502, by addressing the first root cause
(the fix is trivial and hopefully can be serviced).
Moreover, it addresses the only existing UI flow that can trigger the issue.

The remaining problematic flow will occur when the connection is closed.
I have created a separate Issue to track it:
https://github.com/microsoft/terminal/issues/9572
as I guess the PR for it might be more complex.

PR Checklist


🔄 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/9571 **Author:** [@Don-Vito](https://github.com/Don-Vito) **Created:** 3/21/2021 **Status:** ✅ Merged **Merged:** 3/22/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `9502-do-not-close-pane-from-tab` --- ### 📝 Commits (1) - [`e16f243`](https://github.com/microsoft/terminal/commit/e16f243560d8afdfb8c33ddf2f7262c1fed2b8d3) Prevent tab context menu from closing root pane directly ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/TerminalTab.cpp` (+1 -1) </details> ### 📄 Description ## Summary of the Pull Request Currently a repeated attempt to close a read-only tab from context menu, will bring the terminal into invalid state if user dismisses close action. There are two root causes for this: 1. The tab close menu triggers the closing of the root pane (rather than invoking close tab flow in the Terminal Page). 2. Currently panes are not aware that the closing was canceled, and thus they trigger the Closed event, putting the system in a weird state, where the Closed handlers were invoked, but the Pane remains. This PR mitigates #9502, by addressing the first root cause (the fix is trivial and hopefully can be serviced). Moreover, it addresses the only existing UI flow that can trigger the issue. The remaining problematic flow will occur when the connection is closed. I have created a separate Issue to track it: https://github.com/microsoft/terminal/issues/9572 as I guess the PR for it might be more complex. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes https://github.com/microsoft/terminal/issues/9502 * [x] CLA signed. * [ ] Tests added/passed * [ ] Documentation updated. * [ ] Schema updated. * [ ] I've discussed this with core contributors already. --- <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:23:09 +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#27629