| ... | @@ -83,7 +83,12 @@ function startBackend(): void { | ... | @@ -83,7 +83,12 @@ function startBackend(): void { |
| 83 | | 83 | |
| 84 | const child = spawn(process.execPath, [BACKEND_ENTRY], { | 84 | const child = spawn(process.execPath, [BACKEND_ENTRY], { |
| 85 | cwd: ROOT_DIR, | 85 | cwd: ROOT_DIR, |
| 86 | env: backendEnv(), | 86 | // In Electron main, process.execPath points to the Electron binary. |
| | 87 | // Run the child in Node mode so this backend process does not become a GUI app instance. |
| | 88 | env: { |
| | 89 | ...backendEnv(), |
| | 90 | ELECTRON_RUN_AS_NODE: "1", |
| | 91 | }, |
| 87 | stdio: "inherit", | 92 | stdio: "inherit", |
| 88 | }); | 93 | }); |
| 89 | backendProcess = child; | 94 | backendProcess = child; |