diff --git a/main/src/main.ts b/main/src/main.ts index 8774469fd6..05e081a166 100644 --- a/main/src/main.ts +++ b/main/src/main.ts @@ -1,7 +1,7 @@ import * as minimist from "minimist" import * as path from "path" -import { app, BrowserWindow, ipcMain, Menu } from "electron" +import { app, BrowserWindow, ipcMain, Menu, systemPreferences } from "electron" import * as PersistentSettings from "electron-settings" @@ -130,6 +130,18 @@ if (!isDevelopment && !isDebug && !isAutomation) { if (!isAutomation) { await addDevExtensions() } + + if (process.platform.includes("darwin")) { + const pressAndHold = systemPreferences.getUserDefault( + "ApplePressAndHoldEnabled", + "boolean", + ) + + if (pressAndHold) { + const untypedPrefs = systemPreferences as any + untypedPrefs.setUserDefault("ApplePressAndHoldEnabled", "boolean", false) + } + } loadFileFromArguments(process.platform, argsToUse, process.env.ONI_CWD || process.cwd()) }) }