Skip to content

Commit 6281c48

Browse files
authored
fix: fix web terminals not spawning for electron (#736)
1 parent 6830b71 commit 6281c48

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/desktop/terminalWindowManager.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Each workspace can have multiple terminal windows open simultaneously.
66
*/
77

8-
import { BrowserWindow } from "electron";
8+
import { app, BrowserWindow } from "electron";
99
import * as path from "path";
1010
import { log } from "@/node/services/log";
1111
import type { Config } from "@/node/config";
@@ -71,16 +71,18 @@ export class TerminalWindowManager {
7171
});
7272

7373
// Load the terminal page
74-
const isDev = !process.env.NODE_ENV || process.env.NODE_ENV === "development";
74+
// Match main window logic: use dev server unless packaged or MUX_E2E_LOAD_DIST=1
75+
const forceDistLoad = process.env.MUX_E2E_LOAD_DIST === "1";
76+
const useDevServer = !app.isPackaged && !forceDistLoad;
7577

76-
if (isDev) {
78+
if (useDevServer) {
7779
// Development mode - load from Vite dev server
7880
await terminalWindow.loadURL(
7981
`http://localhost:5173/terminal.html?workspaceId=${encodeURIComponent(workspaceId)}`
8082
);
8183
terminalWindow.webContents.openDevTools();
8284
} else {
83-
// Production mode - load from built files
85+
// Production mode (or E2E dist mode) - load from built files
8486
await terminalWindow.loadFile(path.join(__dirname, "../terminal.html"), {
8587
query: { workspaceId },
8688
});

0 commit comments

Comments
 (0)