@devries-cameron20 / t3code Mirror · read-only / commits / 5e35f6ea1c
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 13:15 UTC

fix(desktop): a timed-out login-shell probe no longer skips the server's PATH repair (#21771)

Co-authored-by: maria-rcks <maria@kuuro.net>

tiliakoos committed Oct 29, 2026 at 13:41 UTC 5e35f6ea1cec83da27a456818e5581dd24d325f2
2 files changed +20 -4
apps/desktop/src/shell/DesktopShellEnvironment.test.ts
+16 -2
@@ -149,7 +149,7 @@ describe("DesktopShellEnvironment", () => {
149 };
150 const commands: ChildProcess.Command[] = [];
151
152 - yield* runShellEnvironment({
152 + const prepared = yield* runShellEnvironment({
153 env,
154 platform: "darwin",
155 handler: (command) => {
@@ -167,6 +167,7 @@ describe("DesktopShellEnvironment", () => {
167 assert.equal(env.PATH, "/opt/homebrew/bin:/usr/bin:/Users/test/.local/bin");
168 assert.equal(env.SSH_AUTH_SOCK, "/tmp/secretive.sock");
169 assert.equal(env.HOMEBREW_PREFIX, "/opt/homebrew");
170 + assert.isTrue(prepared);
171 }),
172 );
173
@@ -267,7 +268,7 @@ describe("DesktopShellEnvironment", () => {
268 };
269 const commands: string[] = [];
270
270 - yield* runShellEnvironment({
271 + const prepared = yield* runShellEnvironment({
272 env,
273 platform: "darwin",
274 handler: (command) => {
@@ -279,6 +280,19 @@ describe("DesktopShellEnvironment", () => {
280
281 assert.deepEqual(commands, ["/opt/homebrew/bin/nu", "/bin/zsh", "/bin/launchctl"]);
282 assert.equal(env.PATH, "/opt/homebrew/bin:/usr/bin");
283 + assert.isFalse(prepared);
284 + }),
285 + );
286 +
287 + it.effect("leaves macOS preparation incomplete when no login shell returns a PATH", () =>
288 + Effect.gen(function* () {
289 + const prepared = yield* runShellEnvironment({
290 + env: { SHELL: "/bin/zsh", PATH: "/usr/bin:/bin:/usr/sbin:/sbin" },
291 + platform: "darwin",
292 + handler: () => "",
293 + });
294 +
295 + assert.isFalse(prepared);
296 }),
297 );
298
apps/desktop/src/shell/DesktopShellEnvironment.ts
+4 -2
@@ -392,7 +392,7 @@ const installPosixEnvironment = Effect.fn("desktop.shellEnvironment.installPosix
392 function* (
393 config: ShellEnvironmentConfig,
394 ): Effect.fn.Return<
395 - void,
395 + boolean,
396 never,
397 ChildProcessSpawner.ChildProcessSpawner | FileSystem.FileSystem
398 > {
@@ -491,6 +491,8 @@ const installPosixEnvironment = Effect.fn("desktop.shellEnvironment.installPosix
491 }
492 }
493 }
494 +
495 + return Option.isSome(trimNonEmpty(shellEnvironment.PATH));
496 },
497 );
498
@@ -505,7 +507,7 @@ const installShellEnvironment = (
507 return installWindowsEnvironment(config);
508 }
509 if (config.platform === "darwin" || config.platform === "linux") {
508 - return installPosixEnvironment(config).pipe(Effect.as(true));
510 + return installPosixEnvironment(config);
511 }
512 return Effect.succeed(false);
513 };