[PR #13348] Add support for hiding the tab close button #29495

Closed
opened 2026-01-31 09:35:14 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/13348

State: closed
Merged: Yes


Summary of the Pull Request

Adds support for the tab.showCloseButton property to themes. This accepts three values:

  • "always" (default): The close button acts like it does today.
  • "hover": The close button is always visible on the active tab. On inactive tabs, the close button only appears on mouse over.
  • "never": The close button is never visible. You can't close the tab with middle-click, but you can still use keyboard shortcuts to close the tab.

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

See the following two properties in WInUI that we're leveraging here.

One is a tabview-level property, the other is a per-tab-item property, hence why this code is a little wacky.

Validation Steps Performed

gifs below

**Original Pull Request:** https://github.com/microsoft/terminal/pull/13348 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request Adds support for the `tab.showCloseButton` property to themes. This accepts three values: * `"always"` (default): The close button acts like it does today. * `"hover"`: The close button is always visible on the active tab. On inactive tabs, the close button only appears on mouse over. * `"never"`: The close button is never visible. You can't close the tab with middle-click, but you can still use keyboard shortcuts to close the tab. ## References * See #3327 * ⚠️ targets #13178 ⚠️ ## PR Checklist * [x] Closes #3335 * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated - YUP ## Detailed Description of the Pull Request / Additional comments See the following two properties in WInUI that we're leveraging here. * [`TabViewCloseButtonOverlayMode.OnPointerOver`](https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls.tabviewclosebuttonoverlaymode?view=winui-2.7&viewFallbackFrom=winui-2.2) * [`TabViewItem.IsClosable`](https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls.tabviewitem.isclosable?view=winui-2.2#microsoft-ui-xaml-controls-tabviewitem-isclosable) One is a tabview-level property, the other is a per-tab-item property, hence why this code is a little wacky. ## Validation Steps Performed gifs below
claunia added the pull-request label 2026-01-31 09:35:14 +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#29495