Elffuss BraidHub

kikocis/continue public

Update shellPath.ts
Changesetd077bc7a38b2b193d223b1f32f035b20eb0f519a74daa58dc08c61a32384c554
AuthorPatrick Erichsen <patrick.a.erichsen@gmail.com> · 2025-06-16 18:55 -07:00
CommitterPatrick Erichsen <patrick.a.erichsen@gmail.com> · 2025-06-16 18:55 -07:00
Parentsc3e8fbcfb752

Browse the files at this changeset

1 file changed

modified core/util/shellPath.ts +3 −6
@@ -1,10 +1,6 @@
11 import { execSync } from "child_process";
2+import { homedir } from "os";
23
3-/**
4- * Gets the PATH env var from the user's login shell on non-Windows platforms.
5- * Windows is not implemented primarily because it is not needed at the moment.
6- * @returns The enhanced PATH from the user's shell, or the current PATH if it cannot be determined
7- */
84 export function getEnvPathFromUserShell(): string | undefined {
95 if (process.platform === "win32") {
106 console.warn(`${getEnvPathFromUserShell.name} not implemented for Windows`);
@@ -16,7 +12,8 @@
1612 }
1713
1814 try {
19- const command = `${process.env.SHELL} -l -c 'echo $PATH'`;
15+ // Source common profile files
16+ const command = `${process.env.SHELL} -l -c 'for f in ~/.zprofile ~/.zshrc ~/.bash_profile ~/.bashrc; do [ -f "$f" ] && source "$f" 2>/dev/null; done; echo $PATH'`;
2017
2118 const stdout = execSync(command, {
2219 encoding: "utf8",