Selaa lähdekoodia

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

Brendan Allan 5 päivää sitten
vanhempi
sitoutus
f44aa02e26
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 5 0
      packages/desktop-electron/src/main/index.ts

+ 5 - 0
packages/desktop-electron/src/main/index.ts

@@ -11,6 +11,11 @@ import pkg from "electron-updater"
 import contextMenu from "electron-context-menu"
 import contextMenu from "electron-context-menu"
 contextMenu({ showSaveImageAs: true, showLookUpSelection: false, showSearchWithGoogle: false })
 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"
 process.env.OPENCODE_DISABLE_EMBEDDED_WEB_UI = "true"
 
 
 const APP_NAMES: Record<string, string> = {
 const APP_NAMES: Record<string, string> = {