fix(desktop): chdir to homedir on macOS to fix ripgrep issues (#22537)

This commit is contained in:
Brendan Allan 2026-04-15 10:56:22 +08:00 committed by GitHub
parent 1ca9804604
commit f44aa02e26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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> = {