Skip to content

Add Alt+click to close other tabs (JetBrains-style) #329251

Description

Feature Request

Close all other tabs (except the current one) by alt + clicking an editor tab's close button.

By holding alt over a tab's close button, the button swaps from the "Close" icon to a "Close Other Editors" icon. Clicking it closes all other tabs in the group, leaving the clicked tab open.

Note: If there was an open sticky tab, it stays unchanged.

This is the same behavior as JetBrains IDEs (docs).

Image

Implementation

PR: #328975

Activity

  1. jadefr commented on Aug 6, 2026

    @jadefr
    ContributorAuthor

    This is actually better than JetBrains, as their tooltip is static (doesn't change if alt is pressed) and it shows the tips for both Close and Close Others, making the tooltip polluted.

    Image
  2. added
    feature-request
    workbench-tabs
    on Aug 10, 2026
  3. added
    unreleased
    on Aug 12, 2026
  4. vs-code-engineering commented on Aug 12, 2026

    @vs-code-engineering
    Contributor

    Sharing media and context from merged PR #328975 for verification:

    Add Alt+click to close other tabs (JetBrains-style)

    Close all other tabs (except the current one) by alt + clicking an editor tab's close button.

    By holding alt over an editor tab's close button, the button swaps from the "Close" icon to a "Close Other Editors" icon. Clicking it closes every other non-sticky tab in the group, leaving the clicked tab (and any sticky tabs) open.

    This is the same behavior as JetBrains IDEs (docs).

    Demo

    close-others

    Edge case: tabs whose matches() is intentionally loose

    Some editor inputs (e.g. GettingStartedInput, used for Welcome and walkthrough tabs) override matches() to return true for any instance of the same type, so VS Code can treat them as a reusable singleton pane elsewhere.

    Using matches() to decide what "close others" should close meant that if two such tabs were open together, alt + clicking one would incorrectly spare the other instead of closing it.

    The close filter compares by reference identity instead, since what matters here is "is this literally the tab that was clicked," not "is this the same kind of tab."

    Known limitation

    Pre-existing, not introduced by this PR, workbench.action.closeOtherEditors already has the identical exposure today.

    If two same type loosely-matching tabs (e.g. two GettingStartedInput tabs) are open in one group and the clicked tab is active, closing others can close the wrong one.

    Needs a separate PR to fix it.

    How to test

    1. Open several tabs (leave at least one pinned/sticky, if you'd like to check that case too)
    2. Hover a non-sticky tab's close (×) button and hold alt: the icon swaps to "Close Other Editors"
    3. Click it while alt is held
    4. Expect: every other non-sticky tab closes; sticky tabs and the clicked tab remain open
    5. Release alt without clicking: the icon reverts to the plain Close (×)
    6. Hold alt over a sticky tab's Unpin button: it should stay Unpin, unaffected by Alt

    Test coverage

    multiEditorTabsControl.test.ts (real MultiEditorTabsControl + DOM + EditorGroupModel):

    • Shows Close by default, swaps to Close Other Editors while Alt is held, reverts on release
    • Sticky tabs keep showing Unpin regardless of Alt
    • Clicking while Alt is held closes every other non-sticky tab
    • Handles the matches() edge case above
    • Clicking a sticky tab's Unpin button while Alt is held does not close other tabs
    • Without Alt, clicking closes only that one tab

    editorActions.test.ts (CloseOtherEditorTabsInGroupAction in isolation):

    • Closes every other editor, keeping the target by reference
    • Keys off identity, not matches(), so a loosely-matching editor doesn't wrongly spare the target
    • Does nothing if the group referenced in context can't be resolved
      the setting is off

    Source PR: #328975

  5. added
    insiders-released
    verification-needed
    and removed
    unreleased
    on Aug 12, 2026
  6. dmitrivMS commented on Aug 17, 2026

    @dmitrivMS
    Collaborator

    There is a small issue in that when you hover over the tab, but not the X, we show the multi-X icon, but Alt+Click does nothing:

    Image

  7. 7 remaining items

  8. added
    feature-request
    and removed
    verification-found
    on Aug 18, 2026
  9. benibenj commented on Aug 18, 2026

    @benibenj
    Contributor

    Maybe we could disable the the close others when there is only one tab when pressing alt

  10. added
    unreleased
    on Aug 18, 2026
  11. vs-code-engineering commented on Aug 18, 2026

    @vs-code-engineering
    Contributor

    Sharing media and context from merged PR #331435 for verification:

    Description

    Holding Alt over a tab’s Close action switches it to Close Others. In single-tab groups, this action appeared enabled despite having no other editors to close.

    Changes

    • Disable Close Others when the editor group contains one tab.
    • Keep the alternate action visible while Alt is held.
    • Use the full group count so sticky and non-sticky tab rows remain consistent.
    • Preserve existing sticky-tab and Unpin behavior.

    Demo

    Alt+click Close Others

    Source PR: #331435

  12. added
    insiders-released
    verification-needed
    and removed
    unreleased
    on Aug 18, 2026
  13. oles commented on Aug 22, 2026

    @oles

    I found it a little distracting for the close icon to always change when I press alt, a button I often use for many of my keybindings.

    I'd really like for this to be optional and opt-in, but would be very happy with it just being opt-out too.

    For now, I've patched it manually with CSS to always have the same icon:

    /* replaces the close-all icon on tabs that appears when alt is pressed to always be a normal close icon */
    .tabs-container .tab .tab-actions .monaco-action-bar .action-item .action-label.codicon.codicon-close-all::before {
        content: '\ecee';
    }
    

    via the excellent https://github.com/be5invis/vscode-custom-css extension ✌️

  14. aplotor commented on Aug 22, 2026

    @aplotor

    +1 for this being distracting, especially for users who wont even use this. i hope you will add a setting to let us disable this

  15. locked and limited conversation to collaborators on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestinsiders-releasedverification-neededworkbench-tabs

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions