summaryrefslogtreecommitdiffhomepage
path: root/packages/desktop-electron
diff options
context:
space:
mode:
Diffstat (limited to 'packages/desktop-electron')
-rw-r--r--packages/desktop-electron/electron.vite.config.ts3
-rw-r--r--packages/desktop-electron/package.json2
-rw-r--r--packages/desktop-electron/src/main/apps.ts4
-rw-r--r--packages/desktop-electron/src/main/index.ts5
-rw-r--r--packages/desktop-electron/src/main/shell-env.ts2
-rw-r--r--packages/desktop-electron/src/main/store.ts2
-rw-r--r--packages/desktop-electron/src/main/windows.ts6
7 files changed, 18 insertions, 6 deletions
diff --git a/packages/desktop-electron/electron.vite.config.ts b/packages/desktop-electron/electron.vite.config.ts
index e2b296a3e..d0e6c42b6 100644
--- a/packages/desktop-electron/electron.vite.config.ts
+++ b/packages/desktop-electron/electron.vite.config.ts
@@ -60,6 +60,9 @@ export default defineConfig({
plugins: [appPlugin],
publicDir: "../../../app/public",
root: "src/renderer",
+ define: {
+ "import.meta.env.VITE_OPENCODE_CHANNEL": JSON.stringify(channel),
+ },
build: {
rollupOptions: {
input: {
diff --git a/packages/desktop-electron/package.json b/packages/desktop-electron/package.json
index 694382045..cc0bad7d7 100644
--- a/packages/desktop-electron/package.json
+++ b/packages/desktop-electron/package.json
@@ -1,7 +1,7 @@
{
"name": "@opencode-ai/desktop-electron",
"private": true,
- "version": "1.4.3",
+ "version": "1.4.6",
"type": "module",
"license": "MIT",
"homepage": "https://opencode.ai",
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
}