| ... | @@ -293,11 +293,16 @@ export const launchDetached = (launch: EditorLaunch) => | ... | @@ -293,11 +293,16 @@ export const launchDetached = (launch: EditorLaunch) => |
| 293 | yield* Effect.callback<void, OpenError>((resume) => { | 293 | yield* Effect.callback<void, OpenError>((resume) => { |
| 294 | let child; | 294 | let child; |
| 295 | try { | 295 | try { |
| 296 | child = spawn(launch.command, [...launch.args], { | 296 | const isWin32 = process.platform === "win32"; |
| 297 | detached: true, | 297 | child = spawn( |
| 298 | stdio: "ignore", | 298 | launch.command, |
| 299 | shell: process.platform === "win32", | 299 | isWin32 ? launch.args.map((a) => `"${a}"`) : [...launch.args], |
| 300 | }); | 300 | { |
| | 301 | detached: true, |
| | 302 | stdio: "ignore", |
| | 303 | shell: isWin32, |
| | 304 | }, |
| | 305 | ); |
| 301 | } catch (error) { | 306 | } catch (error) { |
| 302 | return resume( | 307 | return resume( |
| 303 | Effect.fail(new OpenError({ message: "failed to spawn detached process", cause: error })), | 308 | Effect.fail(new OpenError({ message: "failed to spawn detached process", cause: error })), |