Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions src/desktop/terminalWindowManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Each workspace can have multiple terminal windows open simultaneously.
*/

import { BrowserWindow } from "electron";
import { app, BrowserWindow } from "electron";
import * as path from "path";
import { log } from "@/node/services/log";
import type { Config } from "@/node/config";
Expand Down Expand Up @@ -71,19 +71,18 @@ export class TerminalWindowManager {
});

// Load the terminal page
const isDev = !process.env.NODE_ENV || process.env.NODE_ENV === "development";

if (isDev) {
// app.isPackaged is true when running from a built .app/.exe, false in development
if (app.isPackaged) {
// Production mode - load from built files
await terminalWindow.loadFile(path.join(__dirname, "../terminal.html"), {
query: { workspaceId },
});
} else {
// Development mode - load from Vite dev server
await terminalWindow.loadURL(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Load dist terminal assets when dev server absent

In openTerminalWindow the non-packaged path (lines 80‑84) always loads the Vite dev server when app.isPackaged is false, but dist/E2E runs set MUX_E2E_LOAD_DIST=1 and skip the dev server (see tests/e2e/electronTest.ts around lines 127‑210). In that configuration the main window serves built files while terminal windows still target http://localhost:5173/..., so terminals never load. Previously the NODE_ENV check loaded the built terminal.html for this scenario; this change regresses dist-mode terminal windows unless the app is fully packaged.

Useful? React with 👍 / 👎.

`http://localhost:5173/terminal.html?workspaceId=${encodeURIComponent(workspaceId)}`
);
terminalWindow.webContents.openDevTools();
} else {
// Production mode - load from built files
await terminalWindow.loadFile(path.join(__dirname, "../terminal.html"), {
query: { workspaceId },
});
}

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