Skip to content

Require confirmation before closing a pinned tab#654

Open
Eliezergh wants to merge 2 commits intognachman:masterfrom
Eliezergh:pinned-tab-close-protection
Open

Require confirmation before closing a pinned tab#654
Eliezergh wants to merge 2 commits intognachman:masterfrom
Eliezergh:pinned-tab-close-protection

Conversation

@Eliezergh
Copy link
Copy Markdown

Description

This pull request introduces a confirmation dialog whenever a user attempts to close a pinned tab, regardless of the method used (close button, middle-click, ⌘W, or quitting the app).

The confirmation dialog clearly identifies the tab as pinned to avoid accidental closure.

Builds on ed3f5b0 ("Add pinned tabs support") — pinned tabs had no close protection, allowing them to be closed the same as any other tab.

Changes

Pinned Tab Close Confirmation:

  • Added a new close reason, tabIsPinned, to iTermPromptOnCloseReason for use in close confirmation dialogs. [1] [2]
  • Updated the tab close confirmation logic in PseudoTerminal.m to prepend "pinned" to the tab identifier in confirmation dialogs, making it clear when a pinned tab is being closed.
  • Modified the prompt-on-close reason logic to include a reason if any open tab is pinned, ensuring the prompt is shown when quitting with pinned tabs open.
  • Enforced confirmation for closing pinned tabs via the tab close button or middle-click, preventing accidental closure without explicit confirmation.
  • Updated documentation to reflect that closing a pinned tab now always requires confirmation, with the dialog clearly indicating the tab is pinned.
  • Added a release note to notes-3.7.txt.

The tab-bar close flow already runs shouldCloseTabViewItem before closeTab.
Remove the redundant pinned-tab confirmation in closeTab:button: so pinned tabs prompt once (same behavior as Cmd+W).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant