Skip to content

Commit fa9b465

Browse files
committed
fix: fix web terminals not spawning for electron
1 parent 6830b71 commit fa9b465

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/desktop/terminalWindowManager.ts

Lines changed: 8 additions & 9 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,19 +71,18 @@ export class TerminalWindowManager {
7171
});
7272

7373
// Load the terminal page
74-
const isDev = !process.env.NODE_ENV || process.env.NODE_ENV === "development";
75-
76-
if (isDev) {
74+
// app.isPackaged is true when running from a built .app/.exe, false in development
75+
if (app.isPackaged) {
76+
// Production mode - load from built files
77+
await terminalWindow.loadFile(path.join(__dirname, "../terminal.html"), {
78+
query: { workspaceId },
79+
});
80+
} else {
7781
// Development mode - load from Vite dev server
7882
await terminalWindow.loadURL(
7983
`http://localhost:5173/terminal.html?workspaceId=${encodeURIComponent(workspaceId)}`
8084
);
8185
terminalWindow.webContents.openDevTools();
82-
} else {
83-
// Production mode - load from built files
84-
await terminalWindow.loadFile(path.join(__dirname, "../terminal.html"), {
85-
query: { workspaceId },
86-
});
8786
}
8887

8988
log.info(`Terminal window ${windowId} opened for workspace: ${workspaceId}`);

0 commit comments

Comments
 (0)