Due to wmic has been deprecated. Use @vscode/windows-process-tree for Windows process listing with WMIC fallback#991
Open
ZA139 wants to merge 4 commits intomicrosoft:mainfrom
Open
Due to wmic has been deprecated. Use @vscode/windows-process-tree for Windows process listing with WMIC fallback#991ZA139 wants to merge 4 commits intomicrosoft:mainfrom
ZA139 wants to merge 4 commits intomicrosoft:mainfrom
Conversation
Add @vscode/windows-process-tree as a dependency and use it on Windows to enumerate processes (via promisified getAllProcesses). Fall back to the existing WMIC parser when windows-process-tree is unavailable. Update provider logic to return parsed process items from the native API on Windows and keep PS-based listing for macOS/Linux. Update unit tests to stub and exercise the new getAllProcesses flow and the WMIC fallback, and add webpack externals entry for the new native module.
Adjust Windows process provider unit tests to match the updated getAllProcesses API that accepts a flag parameter and uses an error-first callback. Stubs now use signatures like (_flag, callback) and call callback(null, processList); throwing stubs were updated to accept two arguments. These are test-only updates to align with the new function signature.
Replace use of util.promisify with an explicit Promise wrapper around wpc.getAllProcesses, removing the promisify import and adapting the call site to resolve with the process list. Update unit tests to match the changed callback shape (stubs now call callback(processList) and throw without an error-first parameter). This keeps Windows process enumeration working while aligning with the windows-process-tree callback behavior.
Integrate windows-process-tree for Windows process enumeration
Author
|
Hi,@eleanorjboyd @Tyriar Sorry for the delay! Best Regards |
rchiodo
reviewed
Mar 30, 2026
| '@opentelemetry/instrumentation': 'commonjs @opentelemetry/instrumentation', // ignored because we don't ship instrumentation | ||
| '@azure/opentelemetry-instrumentation-azure-sdk': 'commonjs @azure/opentelemetry-instrumentation-azure-sdk', // ignored because we don't ship instrumentation | ||
| '@azure/functions-core': '@azure/functions-core', // ignored because we don't ship instrumentation | ||
| '@vscode/windows-process-tree': 'commonjs @vscode/windows-process-tree', |
Contributor
There was a problem hiding this comment.
I don't think this is correct. It's not an external. We need to have it as part of the webpack. Otherwise VS code would have to provide it?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following up on #858, which replaced WMIC with PowerShell for process listing, this PR takes a different approach by using the native @vscode/windows-process-tree module (getAllProcesses) to enumerate processes on Windows. This avoids spawning external commands entirely and provides better performance.
Changes:
Test changes:
No feature changed. This is an internal improvement to process enumeration reliability on Windows.