From c8ad4b8135dca79c439a44845d270f12c355cfe2 Mon Sep 17 00:00:00 2001 From: Arham Amin <132888838+arhxam@users.noreply.github.com> Date: Mon, 10 Aug 2026 03:15:08 +0530 Subject: [PATCH] fix(shell): add ~/.local/bin to the Windows CLI resolver so native-installed providers are found (#5074) Co-authored-by: Claude Opus 4.8 (1M context) --- apps/desktop/src/shell/DesktopShellEnvironment.test.ts | 1 + apps/desktop/src/shell/DesktopShellEnvironment.ts | 2 +- packages/shared/src/shell.test.ts | 4 ++++ packages/shared/src/shell.ts | 4 +++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/shell/DesktopShellEnvironment.test.ts b/apps/desktop/src/shell/DesktopShellEnvironment.test.ts index b8c66e9b745fade1f6274563bd13fbab25dd3187..831f06f02d356a753746e3b21d07086b2db9dfde 100644 --- a/apps/desktop/src/shell/DesktopShellEnvironment.test.ts +++ b/apps/desktop/src/shell/DesktopShellEnvironment.test.ts @@ -231,6 +231,7 @@ describe("DesktopShellEnvironment", () => { "C:\\Users\\testuser\\AppData\\Local\\Programs\\nodejs", "C:\\Users\\testuser\\AppData\\Local\\Volta\\bin", "C:\\Users\\testuser\\AppData\\Local\\pnpm", + "C:\\Users\\testuser\\.local\\bin", "C:\\Users\\testuser\\.bun\\bin", "C:\\Users\\testuser\\scoop\\shims", "C:\\Custom\\Bin", diff --git a/apps/desktop/src/shell/DesktopShellEnvironment.ts b/apps/desktop/src/shell/DesktopShellEnvironment.ts index 5627eec54ded5568d3f04026a23d21ed3088bece..f1b252f29c8f1cfe0abb8ccf0a0a9db96bfeb4fd 100644 --- a/apps/desktop/src/shell/DesktopShellEnvironment.ts +++ b/apps/desktop/src/shell/DesktopShellEnvironment.ts @@ -207,7 +207,7 @@ const knownWindowsCliDirs = (env: NodeJS.ProcessEnv): ReadonlyArray => [ ...trimNonEmpty(env.USERPROFILE).pipe( Option.match({ onNone: () => [], - onSome: (value) => [`${value}\\.bun\\bin`, `${value}\\scoop\\shims`], + onSome: (value) => [`${value}\\.local\\bin`, `${value}\\.bun\\bin`, `${value}\\scoop\\shims`], }), ), ]; diff --git a/packages/shared/src/shell.test.ts b/packages/shared/src/shell.test.ts index e8b2c41cb77bae211d5ae68d7fc141defc65f038..89ec055f599ebe190f054eb4ce1b8b456747ed73 100644 --- a/packages/shared/src/shell.test.ts +++ b/packages/shared/src/shell.test.ts @@ -336,6 +336,7 @@ describe("resolveKnownWindowsCliDirs", () => { "C:\\Users\\testuser\\AppData\\Local\\Programs\\nodejs", "C:\\Users\\testuser\\AppData\\Local\\Volta\\bin", "C:\\Users\\testuser\\AppData\\Local\\pnpm", + "C:\\Users\\testuser\\.local\\bin", "C:\\Users\\testuser\\.bun\\bin", "C:\\Users\\testuser\\scoop\\shims", ]); @@ -476,6 +477,7 @@ effectIt.layer(NodeServices.layer)("resolveWindowsEnvironment", (it) => { "C:\\Users\\testuser\\AppData\\Local\\Programs\\nodejs", "C:\\Users\\testuser\\AppData\\Local\\Volta\\bin", "C:\\Users\\testuser\\AppData\\Local\\pnpm", + "C:\\Users\\testuser\\.local\\bin", "C:\\Users\\testuser\\.bun\\bin", "C:\\Users\\testuser\\scoop\\shims", "C:\\Shell\\Bin", @@ -524,6 +526,7 @@ effectIt.layer(NodeServices.layer)("resolveWindowsEnvironment", (it) => { "C:\\Users\\testuser\\AppData\\Local\\Programs\\nodejs", "C:\\Users\\testuser\\AppData\\Local\\Volta\\bin", "C:\\Users\\testuser\\AppData\\Local\\pnpm", + "C:\\Users\\testuser\\.local\\bin", "C:\\Users\\testuser\\.bun\\bin", "C:\\Users\\testuser\\scoop\\shims", "C:\\Shell\\Bin", @@ -564,6 +567,7 @@ effectIt.layer(NodeServices.layer)("resolveWindowsEnvironment", (it) => { ).toEqual({ PATH: [ "C:\\Users\\testuser\\AppData\\Roaming\\npm", + "C:\\Users\\testuser\\.local\\bin", "C:\\Users\\testuser\\.bun\\bin", "C:\\Users\\testuser\\scoop\\shims", "C:\\Windows\\System32", diff --git a/packages/shared/src/shell.ts b/packages/shared/src/shell.ts index efdd05683abc6005353f89c9933a541113d8c7ce..da6db2166765cb16b36853a922fc1c2ef5d3e655 100644 --- a/packages/shared/src/shell.ts +++ b/packages/shared/src/shell.ts @@ -682,7 +682,9 @@ export function resolveKnownWindowsCliDirs(env: NodeJS.ProcessEnv): ReadonlyArra ...(appData ? [`${appData}\\npm`] : []), ...(localAppData ? [`${localAppData}\\Programs\\nodejs`, `${localAppData}\\Volta\\bin`] : []), ...(localAppData ? [`${localAppData}\\pnpm`] : []), - ...(userProfile ? [`${userProfile}\\.bun\\bin`, `${userProfile}\\scoop\\shims`] : []), + ...(userProfile + ? [`${userProfile}\\.local\\bin`, `${userProfile}\\.bun\\bin`, `${userProfile}\\scoop\\shims`] + : []), ]; } -- 2.54.0