Skip to content

Feature request: "Kill Other Terminals" button in terminal pane #295740

@j-almenara-r

Description

@j-almenara-r

Currently, in the editor, right-clicking on a tab offers a "Close Others" option which closes all open editors except the active one. I would like a similar functionality for the terminal pane. Specifically, please add a "Kill Other Terminals" button (placed next to the existing "Kill Terminal" button) that, when used, closes all terminals except the one currently in focus.

Image Image

This would help users quickly clear out unused or cluttered terminals while keeping their active session intact, improving workflow efficiency and consistency with the editor's UX.

How to implement (Key Code References by Copilot)

Terminal Actions and Kill Functionality

  • src/vs/workbench/contrib/terminal/browser/terminalActions.ts - Contains the core killInstance function and terminal action registrations including:
  • TerminalCommandId.Kill - Kill active terminal
  • TerminalCommandId.KillAll - Kill all terminals
  • TerminalCommandId.KillActiveTab - Kill selected terminal tab

Menu Configuration

  • src/vs/workbench/contrib/terminal/browser/terminalMenus.ts - Defines where terminal commands appear in context menus and view titles (e.g., MenuId.TerminalTabContext, MenuId.TerminalInstanceContext)

UI Components

  • src/vs/workbench/contrib/terminal/browser/terminalTabsList.ts - Renders terminal tabs with action bars, including the kill button

Icons

  • src/vs/workbench/contrib/terminal/browser/terminalIcons.ts - Defines killTerminalIcon using Codicon.trash

Editor "Close Others" Reference
For comparison with how the editor implements "Close Others":

  • src/vs/workbench/browser/parts/editor/editorActions.ts - Contains CloseEditorsInOtherGroupsAction
  • src/vs/workbench/browser/parts/editor/editor.contribution.ts - Shows CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID menu registration

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions