From 7596b0c902e9d76733e53c4ad00abf77261b38b5 Mon Sep 17 00:00:00 2001 From: Nipun Sujesh Date: Thu, 26 Mar 2026 08:24:08 +0530 Subject: [PATCH 1/2] fix: fall back to POSIX ps flags when ps -lx returns no results BusyBox ps (common on Alpine Linux) doesn't support -lx, so it either errors out or returns its own default format that the parser can't handle. This adds a psFallback lookup using ps -eo pid,ppid,args which is POSIX-compliant and works on BusyBox. --- src/main/ts/ps.ts | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/main/ts/ps.ts b/src/main/ts/ps.ts index eb9a231..1a5b09c 100644 --- a/src/main/ts/ps.ts +++ b/src/main/ts/ps.ts @@ -10,6 +10,7 @@ const LOOKUPS: Record TIngridResponse + fallback?: string }> = { wmic: { cmd: 'wmic process get ProcessId,ParentProcessId,CommandLine', @@ -21,6 +22,14 @@ const LOOKUPS: Record { if (err) { reject(err) cb(err) return } - result.push(...filterProcessList(normalizeOutput(parse(stdout)), query)) + const parsed = filterProcessList(normalizeOutput(parse(stdout)), query) + if (parsed.length === 0 && lookup.fallback) { + const fb = LOOKUPS[lookup.fallback] + exec({ + cmd: fb.cmd, + args: fb.args, + callback: (err2, {stdout: stdout2}) => { + if (err2) { + resolve(result) + cb(null, result) + return + } + result.push(...filterProcessList(normalizeOutput(fb.parse(stdout2)), query)) + resolve(result) + cb(null, result) + }, + sync, + run(cb) { cb() }, + }) + return + } + result.push(...parsed) resolve(result) cb(null, result) } From 78323c4e7fd5fc18f44e460a423b6e92915d6a1c Mon Sep 17 00:00:00 2001 From: Nipun Sujesh Date: Fri, 27 Mar 2026 18:10:23 +0530 Subject: [PATCH 2/2] fix: detect BusyBox upfront and use POSIX ps flags directly --- src/main/ts/ps.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/ts/ps.ts b/src/main/ts/ps.ts index 1a5b09c..2555f1c 100644 --- a/src/main/ts/ps.ts +++ b/src/main/ts/ps.ts @@ -6,6 +6,7 @@ import { exec, type TSpawnCtx } from 'zurk/spawn' const IS_WIN = process.platform === 'win32' const IS_WIN2025_PLUS = IS_WIN && Number.parseInt(os.release().split('.')[2], 10) >= 26_000 // WMIC will be missing in Windows 11 25H2 (kernel >= 26000) +const IS_BUSYBOX = !IS_WIN && fs.existsSync('/bin/busybox') const LOOKUPS: Record