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 24, 11:30 UTC
fix(server): reveal normalized paths in File Explorer (#9551)
Julius Marminge committed
Sep 3, 2026 at 19:07 UTC
617edab6539ee6573055dc9fc45fdeacdb12f673
2 files changed
+19
-5
apps/server/src/process/externalLauncher.test.ts
+10
-4
@@ -206,7 +206,9 @@ it.effect("reveals a file in File Explorer through PowerShell on Windows", () =>
206
const launcher = yield* ExternalLauncher.ExternalLauncher;
207
yield* launcher.launchEditor({
208
editor: "file-manager",
209
- cwd: "C:\\workspace with spaces\\media\\author's clip.mp4",
209
+ // Web file links normalize separators even when the server runs on
210
+ // Windows. Explorer's `/select` switch requires Windows separators.
211
+ cwd: "C:/workspace with spaces/media/author's clip.mp4",
212
reveal: true,
213
});
214
return yield* launcher.resolveFileManagerRevealKind();
@@ -261,8 +263,12 @@ it.skipIf(process.platform !== "win32")(
263
const outputPath = NodePath.join(tempDir, "argv.txt");
264
NodeFS.writeFileSync(recorderPath, `@echo off\r\n>"${outputPath}" echo(%*\r\n`);
265
264
- const target = "C:\\workspace with spaces\\media\\author's clip.mp4";
265
- const source = ExternalLauncher.buildFileExplorerRevealPowerShellSource(recorderPath, target);
266
+ const target = "C:/workspace with spaces/media/author's clip.mp4";
267
+ const explorerTarget = target.replaceAll("/", "\\");
268
+ const source = ExternalLauncher.buildFileExplorerRevealPowerShellSource(
269
+ recorderPath,
270
+ explorerTarget,
271
+ );
272
const powerShellPath = `${process.env.SYSTEMROOT ?? "C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
273
NodeChildProcess.execFileSync(
274
powerShellPath,
@@ -290,7 +296,7 @@ it.skipIf(process.platform !== "win32")(
296
}
297
await sleep(200);
298
const recorded = NodeFS.readFileSync(outputPath, "utf8").trim();
293
- assert.equal(recorded, `/select,"${target}"`);
299
+ assert.equal(recorded, `/select,"${explorerTarget}"`);
300
} finally {
301
NodeFS.rmSync(tempDir, { recursive: true, force: true });
302
}
apps/server/src/process/externalLauncher.ts
+9
-1
@@ -609,6 +609,10 @@ function fileExplorerRevealLaunch(
609
};
610
}
611
612
+function normalizeWindowsFileManagerPath(target: string): string {
613
+ return target.replaceAll("/", "\\");
614
+}
615
+
616
const resolveFileManagerRevealLaunch = Effect.fn("resolveFileManagerRevealLaunch")(function* (
617
target: string,
618
platform: NodeJS.Platform,
@@ -626,7 +630,11 @@ const resolveFileManagerRevealLaunch = Effect.fn("resolveFileManagerRevealLaunch
630
}
631
632
if (platform === "win32") {
629
- return fileExplorerRevealLaunch(target, target, resolvePowerShellPath(env));
633
+ return fileExplorerRevealLaunch(
634
+ target,
635
+ normalizeWindowsFileManagerPath(target),
636
+ resolvePowerShellPath(env),
637
+ );
638
}
639
640
if (