From 3cb648eb3d2ba6bf060090e6564c25963801983e Mon Sep 17 00:00:00 2001 From: C-W-D-Harshit Date: Mon, 23 Mar 2026 17:15:37 +0530 Subject: [PATCH] fix: quote editor launch args with spaces on Windows On Windows, spawn uses shell mode to resolve .cmd/.bat editor commands. This causes paths with spaces to be split into multiple arguments. Quote args containing spaces so the shell treats them as a single value. Fixes #757 --- apps/server/src/open.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/server/src/open.ts b/apps/server/src/open.ts index e7238c04b2..a0a8012a5e 100644 --- a/apps/server/src/open.ts +++ b/apps/server/src/open.ts @@ -234,10 +234,14 @@ export const launchDetached = (launch: EditorLaunch) => yield* Effect.callback((resume) => { let child; try { - child = spawn(launch.command, [...launch.args], { + const useShell = process.platform === "win32"; + const args = useShell + ? launch.args.map((a) => (a.includes(" ") ? `"${a}"` : a)) + : [...launch.args]; + child = spawn(launch.command, args, { detached: true, stdio: "ignore", - shell: process.platform === "win32", + shell: useShell, }); } catch (error) { return resume(