From 385b957ed3289cd6c371a9f9d0ba34ef98bd767f Mon Sep 17 00:00:00 2001 From: Huzaifa Abdul Rehman Date: Thu, 23 Jul 2026 14:24:52 +0500 Subject: [PATCH 1/2] Fix portable remote process ps command --- Extension/CHANGELOG.md | 1 + Extension/src/Debugger/nativeAttach.ts | 2 +- .../scenarios/SingleRootProject/tests/extension.test.ts | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index 0d8e5c500..f97447d89 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -2,6 +2,7 @@ ## Version 1.33.4: July 8, 2026 ### Bug Fixes +* Fix remote process selection on systems with personality-dependent `ps` option parsing. [#14442](https://github.com/microsoft/vscode-cpptools/issues/14442) * Fix the wording for the `#include` errors detected message. [#8227](https://github.com/microsoft/vscode-cpptools/issues/8227) * Fix another "directory_cache" crash. * Update some localization. diff --git a/Extension/src/Debugger/nativeAttach.ts b/Extension/src/Debugger/nativeAttach.ts index 669fe7570..462facd8d 100644 --- a/Extension/src/Debugger/nativeAttach.ts +++ b/Extension/src/Debugger/nativeAttach.ts @@ -117,7 +117,7 @@ export class PsProcessParser { // Note that comm on Linux systems is truncated to 16 characters: // https://bugzilla.redhat.com/show_bug.cgi?id=429565 // Since 'args' contains the full path to the executable, even if truncated, searching will work as desired. - public static get psLinuxCommand(): string { return `ps axww -o pid=,comm=${PsProcessParser.commColumnTitle},args=`; } + public static get psLinuxCommand(): string { return `ps axww -o pid= -o comm=${PsProcessParser.commColumnTitle} -o args=`; } public static get psDarwinCommand(): string { return `ps axww -o pid=,comm=${PsProcessParser.commColumnTitle},args= -c`; } public static get psToyboxCommand(): string { return `ps -A -o pid=,comm=${PsProcessParser.commColumnTitle},args=`; } diff --git a/Extension/test/scenarios/SingleRootProject/tests/extension.test.ts b/Extension/test/scenarios/SingleRootProject/tests/extension.test.ts index 62f06236a..ad51cf7b5 100644 --- a/Extension/test/scenarios/SingleRootProject/tests/extension.test.ts +++ b/Extension/test/scenarios/SingleRootProject/tests/extension.test.ts @@ -126,6 +126,12 @@ suite("Pick Process Tests", () => { assert.equal(process2.pid, '15220'); }); + test("Use portable ps options on Linux", () => { + assert.equal( + PsProcessParser.psLinuxCommand, + `ps axww -o pid= -o comm=${'a'.repeat(49)} -o args=`); + }); + test('Parse valid CIM output', () => { // output from the command used in CimAttachItemsProvider const cimOutput: string = String.raw`[ From 316ddfb5fb9221d2270f555918e62cfe30dd3ad8 Mon Sep 17 00:00:00 2001 From: Huzaifa Abdul Rehman Date: Thu, 23 Jul 2026 22:50:22 +0500 Subject: [PATCH 2/2] chore: remove premature changelog entry --- Extension/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index f97447d89..0d8e5c500 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -2,7 +2,6 @@ ## Version 1.33.4: July 8, 2026 ### Bug Fixes -* Fix remote process selection on systems with personality-dependent `ps` option parsing. [#14442](https://github.com/microsoft/vscode-cpptools/issues/14442) * Fix the wording for the `#include` errors detected message. [#8227](https://github.com/microsoft/vscode-cpptools/issues/8227) * Fix another "directory_cache" crash. * Update some localization.