From 3f993c931d023fcd091e6c8aac20ef5e7037f231 Mon Sep 17 00:00:00 2001 From: d3oxy Date: Tue, 7 Apr 2026 12:30:10 +0530 Subject: [PATCH] fix: quote args in launchDetached on Windows to support paths with spaces On Windows, `launchDetached` uses `shell: true` so that editor commands are resolved via PATH. However, when the shell parses the concatenated command string, spaces in file paths are treated as argument separators. This causes "Open in Editor" to open one tab per word in the path instead of opening the project folder. Wrap each argument in double quotes on Windows before passing to `spawn()` so the shell keeps paths intact. Fixes #1804 --- apps/server/src/open.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/server/src/open.ts b/apps/server/src/open.ts index ef50d3a5b8..25c2d6a873 100644 --- a/apps/server/src/open.ts +++ b/apps/server/src/open.ts @@ -293,11 +293,16 @@ export const launchDetached = (launch: EditorLaunch) => yield* Effect.callback((resume) => { let child; try { - child = spawn(launch.command, [...launch.args], { - detached: true, - stdio: "ignore", - shell: process.platform === "win32", - }); + const isWin32 = process.platform === "win32"; + child = spawn( + launch.command, + isWin32 ? launch.args.map((a) => `"${a}"`) : [...launch.args], + { + detached: true, + stdio: "ignore", + shell: isWin32, + }, + ); } catch (error) { return resume( Effect.fail(new OpenError({ message: "failed to spawn detached process", cause: error })),