fix: quote editor launch args on Windows to support paths with spaces (#1805)

This commit is contained in:
Ishan authored and GitHub committed 2026-04-12 00:41:11 -07:00
1 parent f9019cd63f
commit 2fce84a1d4
1 file changed
+10 -5
+10 -5
View File
@@ -293,11 +293,16 @@ export const launchDetached = (launch: EditorLaunch) =>
yield* Effect.callback<void, OpenError>((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 })),