diff options
Diffstat (limited to 'packages/desktop-electron/src')
| -rw-r--r-- | packages/desktop-electron/src/main/apps.ts | 4 | ||||
| -rw-r--r-- | packages/desktop-electron/src/main/index.ts | 5 | ||||
| -rw-r--r-- | packages/desktop-electron/src/main/shell-env.ts | 2 | ||||
| -rw-r--r-- | packages/desktop-electron/src/main/store.ts | 2 | ||||
| -rw-r--r-- | packages/desktop-electron/src/main/windows.ts | 6 |
5 files changed, 14 insertions, 5 deletions
diff --git a/packages/desktop-electron/src/main/apps.ts b/packages/desktop-electron/src/main/apps.ts index 2b4603789..174da94a5 100644 --- a/packages/desktop-electron/src/main/apps.ts +++ b/packages/desktop-electron/src/main/apps.ts @@ -20,7 +20,7 @@ export function wslPath(path: string, mode: "windows" | "linux" | null): string try { if (path.startsWith("~")) { const suffix = path.slice(1) - const cmd = `wslpath ${flag} \"$HOME${suffix.replace(/\"/g, '\\"')}\"` + const cmd = `wslpath ${flag} "$HOME${suffix.replace(/"/g, '\\"')}"` const output = execFileSync("wsl", ["-e", "sh", "-lc", cmd]) return output.toString().trim() } @@ -28,7 +28,7 @@ export function wslPath(path: string, mode: "windows" | "linux" | null): string const output = execFileSync("wsl", ["-e", "wslpath", flag, path]) return output.toString().trim() } catch (error) { - throw new Error(`Failed to run wslpath: ${String(error)}`) + throw new Error(`Failed to run wslpath: ${String(error)}`, { cause: error }) } } diff --git a/packages/desktop-electron/src/main/index.ts b/packages/desktop-electron/src/main/index.ts index 89e7c61ac..946e01e32 100644 --- a/packages/desktop-electron/src/main/index.ts +++ b/packages/desktop-electron/src/main/index.ts @@ -11,6 +11,11 @@ import pkg from "electron-updater" import contextMenu from "electron-context-menu" contextMenu({ showSaveImageAs: true, showLookUpSelection: false, showSearchWithGoogle: false }) +// on macOS apps run in `/` which can cause issues with ripgrep +try { + process.chdir(homedir()) +} catch {} + process.env.OPENCODE_DISABLE_EMBEDDED_WEB_UI = "true" const APP_NAMES: Record<string, string> = { diff --git a/packages/desktop-electron/src/main/shell-env.ts b/packages/desktop-electron/src/main/shell-env.ts index 8453a5730..f57677323 100644 --- a/packages/desktop-electron/src/main/shell-env.ts +++ b/packages/desktop-electron/src/main/shell-env.ts @@ -82,7 +82,7 @@ export function loadShellEnv(shell: string) { export function mergeShellEnv(shell: Record<string, string> | null, env: Record<string, string>) { return { - ...(shell || {}), + ...shell, ...env, } } diff --git a/packages/desktop-electron/src/main/store.ts b/packages/desktop-electron/src/main/store.ts index cf2d25b11..709e820e2 100644 --- a/packages/desktop-electron/src/main/store.ts +++ b/packages/desktop-electron/src/main/store.ts @@ -7,7 +7,7 @@ const cache = new Map<string, Store>() export function getStore(name = SETTINGS_STORE) { const cached = cache.get(name) if (cached) return cached - const next = new Store({ name, fileExtension: "" }) + const next = new Store({ name, fileExtension: "", accessPropertiesByDotNotation: false }) cache.set(name, next) return next } diff --git a/packages/desktop-electron/src/main/windows.ts b/packages/desktop-electron/src/main/windows.ts index 170cd877c..95f80c124 100644 --- a/packages/desktop-electron/src/main/windows.ts +++ b/packages/desktop-electron/src/main/windows.ts @@ -66,7 +66,7 @@ export function createMainWindow(globals: Globals) { y: state.y, width: state.width, height: state.height, - show: true, + show: false, title: "OpenCode", icon: iconPath(), backgroundColor, @@ -94,6 +94,10 @@ export function createMainWindow(globals: Globals) { wireZoom(win) injectGlobals(win, globals) + win.once("ready-to-show", () => { + win.show() + }) + return win } |
