Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): reveal normalized paths in File Explorer #9551

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/9551/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 19 additions and 5 deletions.

x
0 of 2 viewed, 2 left
10 additions and 4 deletionsapps/server/src/process/externalLauncher.test.tsModified
View file
@@ -206,7 +206,9 @@
const launcher = yield* ExternalLauncher.ExternalLauncher;
yield* launcher.launchEditor({
editor: "file-manager",
- cwd: "C:\\workspace with spaces\\media\\author's clip.mp4",
+ // Web file links normalize separators even when the server runs on
+ // Windows. Explorer's `/select` switch requires Windows separators.
+ cwd: "C:/workspace with spaces/media/author's clip.mp4",
reveal: true,
});
return yield* launcher.resolveFileManagerRevealKind();
@@ -261,8 +263,12 @@
const outputPath = NodePath.join(tempDir, "argv.txt");
NodeFS.writeFileSync(recorderPath, `@echo off\r\n>"${outputPath}" echo(%*\r\n`);
​
- const target = "C:\\workspace with spaces\\media\\author's clip.mp4";
- const source = ExternalLauncher.buildFileExplorerRevealPowerShellSource(recorderPath, target);
+ const target = "C:/workspace with spaces/media/author's clip.mp4";
+ const explorerTarget = target.replaceAll("/", "\\");
+ const source = ExternalLauncher.buildFileExplorerRevealPowerShellSource(
+ recorderPath,
+ explorerTarget,
+ );
const powerShellPath = `${process.env.SYSTEMROOT ?? "C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
NodeChildProcess.execFileSync(
powerShellPath,
@@ -290,7 +296,7 @@