Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): request a new Explorer window when revealing files #11174

ClosedMatthewFeroz(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/11174/headopened View on GitHub

Showing 2 changed files with 10 additions and 10 deletions.

x
0 of 2 viewed, 2 left
7 additions and 7 deletionsapps/server/src/process/externalLauncher.test.tsModified
View file
@@ -242,11 +242,11 @@
]);
const encodedCommand = spawned.args[spawned.args.length - 1] ?? "";
const decodedCommand = Buffer.from(encodedCommand, "base64").toString("utf16le");
- // explorer.exe expects `/select,"<path>"` with only the path quoted;
+ // Request a new window with `/n,/select,"<path>"`, quoting only the path;
// PowerShell 5.1's Start-Process passes the argument string verbatim.
assert.equal(
decodedCommand,
- "$ProgressPreference = 'SilentlyContinue'; Start-Process 'explorer.exe' -ArgumentList ('/select,\"' + 'C:\\workspace with spaces\\media\\author''s clip.mp4' + '\"')",
+ "$ProgressPreference = 'SilentlyContinue'; Start-Process 'explorer.exe' -ArgumentList ('/n,/select,\"' + 'C:\\workspace with spaces\\media\\author''s clip.mp4' + '\"')",
assert.equal(spawned.options.shell, false);
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
@@ -255,12 +255,12 @@
// Real-chain smoke check for the Explorer selection contract: runs the exact
// PowerShell source the reveal launch encodes, against a stub that records
// the raw argument tail it receives, and asserts a spaced path arrives as the
-// single `/select,"<path>"` switch. Mock argv assertions cannot prove this —
+// raw `/n,/select,"<path>"` switches. Mock argv assertions cannot prove this —
// only Windows' own PowerShell -> CreateProcess quoting chain can, so the
// test runs only where that chain exists.
// oxlint-disable-next-line t3code/no-global-process-runtime -- the skip decision needs the real host platform, outside any Effect runtime.
it.skipIf(process.platform !== "win32")(
- "delivers the raw /select switch for spaced paths through real PowerShell",
+ "delivers the raw new-window reveal switches for spaced paths through real PowerShell",
{ timeout: 60_000 },
async () => {
const tempDir = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "t3-reveal-smoke-"));