[PR #9573] [MERGED] Fix read-only tab dialog to cancel tab closing when dismissed #27628

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/9573
Author: @Don-Vito
Created: 3/21/2021
Status: Merged
Merged: 3/22/2021
Merged by: @undefined

Base: mainHead: abort-ro-close-on-esc


📝 Commits (1)

  • 439c58b Fix read-only pane dialog to cancel tab closing when dismissed

📊 Changes

3 files changed (+7 additions, -7 deletions)

View changed files

📝 src/cascadia/TerminalApp/Resources/en-US/Resources.resw (+2 -2)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+4 -4)
📝 src/cascadia/TerminalApp/TerminalPage.xaml (+1 -1)

📄 Description

Currently dismissing "are you sure you wish to close read-only tab or pane"
dialog by pressing ESC will not abort tab closing
(aka the tab will be closed!)

The reason for this, is that we cancel, only if the "Cancel" is pressed
(aka result=PrimaryButton, while ESC returns result=None).

This PR fixes this, by doing what we usually do:

  • Putting Cancel in the CloseButton (which is also triggered by ESC)
  • Aborting the action if the result is not a Primary Button

However, since we want Cancel to be a default action,
we set CloseButton to be the DefaultButton in XAML


🔄 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/9573 **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:** `abort-ro-close-on-esc` --- ### 📝 Commits (1) - [`439c58b`](https://github.com/microsoft/terminal/commit/439c58b5ef5447828ec4ff47b43cab835327b417) Fix read-only pane dialog to cancel tab closing when dismissed ### 📊 Changes **3 files changed** (+7 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/Resources/en-US/Resources.resw` (+2 -2) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+4 -4) 📝 `src/cascadia/TerminalApp/TerminalPage.xaml` (+1 -1) </details> ### 📄 Description Currently dismissing "are you sure you wish to close read-only tab or pane" dialog by pressing `ESC` will not abort tab closing (aka the tab will be closed!) The reason for this, is that we cancel, only if the "Cancel" is pressed (aka result=PrimaryButton, while ESC returns result=None). This PR fixes this, by doing what we usually do: * Putting Cancel in the CloseButton (which is also triggered by ESC) * Aborting the action if the result is not a Primary Button However, since we want Cancel to be a default action, we set CloseButton to be the DefaultButton in XAML --- <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#27628