Skip to content

Fix portable ps command for remote process picker#14592

Merged
bobbrow merged 2 commits into
microsoft:mainfrom
HuzaifaAbdulRehman:fix-14442-portable-remote-ps
Jul 23, 2026
Merged

Fix portable ps command for remote process picker#14592
bobbrow merged 2 commits into
microsoft:mainfrom
HuzaifaAbdulRehman:fix-14442-portable-remote-ps

Conversation

@HuzaifaAbdulRehman

@HuzaifaAbdulRehman HuzaifaAbdulRehman commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #14442.

The Linux remote process picker now passes each output column to ps with a separate -o option. This avoids the personality-dependent interpretation of comma-separated format specifications while preserving the existing PID, command name, and arguments output layout.

A regression test verifies the portable command construction.

Validation

  • corepack yarn compile (passed)
  • Targeted ESLint for the changed TypeScript files (passed)
  • git diff --check (passed)
  • Executed the new command under Ubuntu/WSL and confirmed it produces the expected fixed-width PID, command, and arguments columns

The SingleRootProject scenario runner could not execute locally because the native cpptools binaries are not included in the public source checkout. The scenario test containing the new assertion compiled successfully.

@HuzaifaAbdulRehman

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Comment thread Extension/CHANGELOG.md Outdated
@HuzaifaAbdulRehman

Copy link
Copy Markdown
Contributor Author

@bobbrow The Linux and Windows checks are failing during dependency installation because the Azure package registry returns HTTP 503 responses (for mkdirp and each-props respectively). The macOS check passed, and neither failing job reached the build or the changed code. I attempted to rerun the failed workflows, but GitHub requires repository admin access. Could you please rerun them when convenient?

@bobbrow bobbrow added this to the 1.33.5 milestone Jul 23, 2026
@bobbrow
bobbrow merged commit 42c703e into microsoft:main Jul 23, 2026
6 of 8 checks passed
@github-project-automation github-project-automation Bot moved this from Pull Request to Done in cpptools Jul 23, 2026
@sean-mcmanus
sean-mcmanus requested a review from Copilot July 24, 2026 13:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Linux remote process picker failures on systems where ps interprets comma-separated -o formats differently (personality-dependent behavior), by constructing a more portable ps command.

Changes:

  • Update Linux ps invocation to pass each output column with a separate -o option.
  • Add a regression test asserting the portable Linux ps command string.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
Extension/src/Debugger/nativeAttach.ts Updates PsProcessParser.psLinuxCommand to use repeated -o options for portability.
Extension/test/scenarios/SingleRootProject/tests/extension.test.ts Adds a regression test verifying the Linux ps command construction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Extension/test/scenarios/SingleRootProject/tests/extension.test.ts
Comment thread Extension/src/Debugger/nativeAttach.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

pickRemoteProcess relies on personality-depenendent behavior of ps that breaks on some systems

3 participants