# pane: 'Close others' now closes relative to right-clicked tab \(\#34355\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/00ec2437710127328bc11e6c7c57f27837606c14)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 00ec2437710127328bc11e6c7c57f27837606c14

Requested commit: 00ec2437710127328bc11e6c7c57f27837606c14

Commit: 00ec2437710127328bc11e6c7c57f27837606c14

Tree: c4228d36623cef0059ac6d6f29ddd29cbced13af

Author: vipex

Committer: GitHub

## Message

```
pane: 'Close others' now closes relative to right-clicked tab (#34355)

Closes #33445

Fixed the "Close others" context menu action to close tabs relative to
the right-clicked tab instead of the currently active tab. Previously,
when right-clicking on an inactive tab and selecting "Close others", it
would keep the active tab open rather than the right-clicked tab.

## Before/After

https://github.com/user-attachments/assets/d76854c3-c490-4a41-8166-309dec26ba8a



## Changes

- Modified `close_inactive_items()` method to accept an optional
`target_item_id` parameter
- Updated context menu handler to pass the right-clicked tab's ID as the
target
- Maintained backward compatibility by defaulting to active tab when no
target is specified
- Updated all existing call sites to pass `None` for the new parameter

Release Notes:

- Fixed: "Close others" context menu action now correctly keeps the
right-clicked tab open instead of the active tab
```

## Parents

- [84124c60db66416748e2f0971f2c232a0dbad5fe](https://git.cafe/gitcafe/zed/commit/84124c60db66416748e2f0971f2c232a0dbad5fe?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/00ec2437710127328bc11e6c7c57f27837606c14?format=markdown)
