Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): normalize paths and auto-reveal in File Explorer on Windows #12595

ClosedVitaCodez(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/12595/headopened View on GitHub

Showing 2 changed files with 196 additions and 0 deletions (loading 1).

x
0 of 2 viewed, 2 left
196 additions and 0 deletionsapps/server/src/process/externalLauncher.test.tsModified
View file
@@ -341,6 +341,202 @@
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
​
+it.effect(
+ "normalizes forward slashes and strips position suffixes when opening a folder in File Explorer on Windows",
+ () =>
+ Effect.gen(function* () {
+ const fileSystem = yield* FileSystem.FileSystem;
+ const path = yield* Path.Path;
+ const binDir = yield* fileSystem.makeTempDirectoryScoped({ prefix: "t3-editors-" });
+ yield* fileSystem.writeFileString(path.join(binDir, "explorer.CMD"), "@echo off\r\n");
+ const systemRoot = path.join(binDir, "system-root");
+​
+ let spawned: ChildProcess.StandardCommand | undefined;
+ yield* Effect.gen(function* () {
+ const launcher = yield* ExternalLauncher.ExternalLauncher;
+ yield* launcher.launchEditor({
+ editor: "file-manager",
+ cwd: "C:/workspace with spaces/media:42:10",
+ });
+ }).pipe(
+ Effect.provide(
+ testLayer({
+ platform: "win32",
+ env: { PATH: binDir, PATHEXT: ".COM;.EXE;.BAT;.CMD", SYSTEMROOT: systemRoot },
+ onSpawn: (command) => {
+ spawned = command;
+ },
+ }),