You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add Alt+click to close other tabs (JetBrains-style) #329251
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).
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.
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
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
Open several tabs (leave at least one pinned/sticky, if you'd like to check that case too)
Hover a non-sticky tab's close (×) button and hold alt: the icon swaps to "Close Other Editors"
Click it while alt is held
Expect: every other non-sticky tab closes; sticky tabs and the clicked tab remain open
Release alt without clicking: the icon reverts to the plain Close (×)
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
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.
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';
}
Activity
jadefr commentedon Aug 6, 2026
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.
vs-code-engineering commentedon Aug 12, 2026
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
Edge case: tabs whose
matches()is intentionally looseSome editor inputs (e.g.
GettingStartedInput, used for Welcome and walkthrough tabs) overridematches()to returntruefor 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.closeOtherEditorsalready has the identical exposure today.If two same type loosely-matching tabs (e.g. two
GettingStartedInputtabs) 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
Test coverage
multiEditorTabsControl.test.ts(realMultiEditorTabsControl+ DOM +EditorGroupModel):matches()edge case aboveeditorActions.test.ts(CloseOtherEditorTabsInGroupActionin isolation):matches(), so a loosely-matching editor doesn't wrongly spare the targetthe setting is off
Source PR: #328975
dmitrivMS commentedon Aug 17, 2026
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:
7 remaining items
benibenj commentedon Aug 18, 2026
Maybe we could disable the the close others when there is only one tab when pressing alt
vs-code-engineering commentedon Aug 18, 2026
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
Demo
Source PR: #331435
oles commentedon Aug 22, 2026
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:
via the excellent https://github.com/be5invis/vscode-custom-css extension ✌️
aplotor commentedon Aug 22, 2026
+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