-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Add "Close All Other Windows" command to VS Code #251291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com>
@copilot Red CI |
Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
Fixed test mocking issues that were likely causing CI failures. Updated the test to use proper sinon-based mocking instead of globalThis manipulation, and improved import patterns to match VS Code conventions. Commit: 451af70 Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
@copilot only get back to me once Code OSS build check is green! |
Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Summary
Implements a new command
workbench.action.closeAllOtherWindows
that allows users to close all open windows except the currently active one. This addresses a common workflow need for users working with multiple VS Code windows.Changes
New Command Implementation
workbench.action.closeAllOtherWindows
Technical Implementation
CloseAllOtherWindowsAction
class insrc/vs/workbench/electron-browser/actions/windowActions.ts
CloseWindowAction
)INativeHostService
for window management:getWindows({ includeAuxiliaryWindows: true })
to retrieve all windowsgetActiveWindow().vscodeWindowId
to identify current windowcloseWindow({ targetWindowId })
to close each non-current windowPromise.allSettled()
for robust concurrent window closingRegistration
src/vs/workbench/electron-browser/desktop.contribution.ts
Testing
src/vs/workbench/electron-browser/actions/test/windowActions.test.ts
INativeHostService
for isolated testingUsage
Users can now:
Ctrl+Shift+P
→ "Close All Other Windows"Scope
This feature is specific to the Electron (desktop) environment where multiple native windows are supported. The browser version already handles window management through existing host service patterns.
Code Quality
localize2()
usage for internationalizationThe implementation follows all VS Code coding guidelines including tab indentation, localization patterns, and architectural conventions.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
electronjs.org
node-gyp
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.