@devries-cameron20 / t3code-1 / commits / 2e8d70b232
Fork 0

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

fix(server): opening a folder in File Explorer no longer lands on the wrong folder (#18549)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Aqua committed Oct 18, 2026 at 15:19 UTC 2e8d70b2323a4a971d025a783a13713269515281
2 files changed +33 -1
apps/server/src/process/externalLauncher.test.ts
+28
@@ -302,6 +302,34 @@ it.effect("launches Cursor in classic IDE mode through the Windows command shim"
302 }).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
303 );
304
305 +it.effect("opens a folder in File Explorer with Windows separators", () =>
306 + Effect.gen(function* () {
307 + const fileSystem = yield* FileSystem.FileSystem;
308 + const path = yield* Path.Path;
309 + const binDir = yield* fileSystem.makeTempDirectoryScoped({ prefix: "t3-editors-" });
310 + yield* fileSystem.writeFileString(path.join(binDir, "explorer.EXE"), "");
311 +
312 + let spawned: ChildProcess.StandardCommand | undefined;
313 + yield* Effect.gen(function* () {
314 + const launcher = yield* ExternalLauncher.ExternalLauncher;
315 + yield* launcher.launchEditor({ editor: "file-manager", cwd: "C:/workspace/project" });
316 + }).pipe(
317 + Effect.provide(
318 + layerTest({
319 + platform: "win32",
320 + env: { PATH: binDir, PATHEXT: ".COM;.EXE;.BAT;.CMD" },
321 + onSpawn: (command) => {
322 + spawned = command;
323 + },
324 + }),
325 + ),
326 + );
327 +
328 + assert.ok(spawned);
329 + assert.deepEqual(spawned.args, ["C:\\workspace\\project"]);
330 + }).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
331 +);
332 +
333 it.effect.skipIf(windowsHost)("reveals a file in Finder with open -R on macOS", () =>
334 Effect.gen(function* () {
335 const fileSystem = yield* FileSystem.FileSystem;
apps/server/src/process/externalLauncher.ts
+5 -1
@@ -553,7 +553,11 @@ const resolveEditorLaunch = Effect.fn("resolveEditorLaunch")(function* (
553 args:
554 command === "explorer.exe" && env.WSL_DISTRO_NAME !== undefined
555 ? [resolveWslFileManagerPath(input.cwd, env.WSL_DISTRO_NAME)]
556 - : [input.cwd],
556 + : platform === "win32"
557 + ? // Explorer reads `/` as a switch, so `C:/repo` silently opens
558 + // a default folder instead of the target.
559 + [normalizeWindowsFileManagerPath(input.cwd)]
560 + : [input.cwd],
561 };
562 });
563