diff --git a/src/main/index.ts b/src/main/index.ts index 6f682efb6b..e3a49ccaf9 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -4,7 +4,7 @@ import "../common/system-ca"; import "../common/prometheus-providers"; import * as Mobx from "mobx"; import * as LensExtensions from "../extensions/core-api"; -import { app, dialog } from "electron"; +import { app, dialog, powerMonitor } from "electron"; import { appName } from "../common/vars"; import path from "path"; import { LensProxy } from "./lens-proxy"; @@ -55,6 +55,10 @@ app.on("second-instance", () => { windowManager?.ensureMainWindow(); }); +powerMonitor.on("shutdown", () => { + app.exit(); +}); + app.on("ready", async () => { logger.info(`🚀 Starting Lens from "${workingDir}"`); await shellSync();