feat:Add getAllProcesses API for retrieving all system processes#84
Open
ZA139 wants to merge 3 commits intomicrosoft:mainfrom
Open
feat:Add getAllProcesses API for retrieving all system processes#84ZA139 wants to merge 3 commits intomicrosoft:mainfrom
ZA139 wants to merge 3 commits intomicrosoft:mainfrom
Conversation
Introduces the getAllProcesses function to retrieve a list of all processes on Windows systems, with both callback and Promise-based interfaces. Updates typings to reflect the new API.
Introduces the getAllProcesses function to the promises module, updates type definitions, and adds unit tests to verify its behavior and flag support.
Corrected spacing in array declaration in index.ts, added missing newline in promises.ts and typings, and clarified the test description for getAllProcesses to specify use of the native API.
Author
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.
Add getAllProcesses API for retrieving all system processes
📝 Description
This PR introduces a new
getAllProcesses()API to retrieve a comprehensive list of all processes currently running on the Windows system, complementing the existing process-related APIs.✨ Changes
Core Implementation
getAllProcesses()Files Changed
lib/index.ts - Core implementation with promisify support
getAllProcesses()function__promisify__()for Promise supportpromisify.customsymbollib/promises.ts - Promise wrapper
lib/test.ts - Comprehensive test suite
typings/windows-process-tree.d.ts - Type definitions
typings/windows-process-tree/promises.d.ts - Promise type definitions
🎯 Motivation
Background
WMIC is deprecated in Windows 10 (21H1+) and Windows Server 2022+, breaking the Python debugger's attach-to-process functionality.
Solution Strategy
The Python debugger is transitioning from shelling out to external tools (PowerShell/WMIC) to using the native
vscode-windows-process-treepackage for:Why
getAllProcesses()?The existing
getProcessList(rootPid)requires a root PID parameter. For the Python debugger's process picker, we need to enumerate all processes without PID filtering. This new API fills that gap.🔗 Related Issues
🧪 Testing
All tests passing ✅
©Copyright
// This PR description was compiled by AI
// No programmers were harmed in the making of this description