[PR #15924] Allow closing tabs with middle mouse button when close button is hidden #30780

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

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

State: closed
Merged: Yes


Summary of the Pull Request

This commit fixes the middle mouse button handler. The PointerReleased callback is registered, but it is not operational because, on the Release event, the mouse button is no longer pressed. We need to track its state and act accordingly.

Issue was introduced by commit 05e7ea1423, which changed the event handler from PointerPressed to PointerReleased, rendering it inoperative. Instead, the default handler is used. The main issue is that when the close button is hidden with the showCloseButton option, the default handler no longer closes the tab on middle mouse clicks.

Also made it consistent with the Settings tab, which was never converted to PointerReleased and is still handled with a custom handler.

References and Relevant Issues

Related commit 05e7ea1423

Validation Steps Performed

I've been using this commit locally for quite some time, figured out I might as well share it.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/15924 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request This commit fixes the middle mouse button handler. The `PointerReleased` callback is registered, but it is not operational because, on the Release event, the mouse button is no longer pressed. We need to track its state and act accordingly. Issue was introduced by commit 05e7ea1423ede8ee67c3462fb04538fae5c9f9b2, which changed the event handler from `PointerPressed` to `PointerReleased`, rendering it inoperative. Instead, the default handler is used. The main issue is that when the close button is hidden with the `showCloseButton` option, the default handler no longer closes the tab on middle mouse clicks. Also made it consistent with the Settings tab, which was never converted to `PointerReleased` and is still handled with a custom handler. ## References and Relevant Issues Related commit 05e7ea1423ede8ee67c3462fb04538fae5c9f9b2 ## Validation Steps Performed I've been using this commit locally for quite some time, figured out I might as well share it.
claunia added the pull-request label 2026-01-31 09:42:54 +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#30780