From b2cf000293913e88bdb84e522a4d97d6c12e5be5 Mon Sep 17 00:00:00 2001 From: Jokin Date: Tue, 14 Jul 2026 17:51:29 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20=E2=8C=98Q=20not=20quitting=20on=20macOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Quit item was role:"quit" with no accelerator, so ⌘Q was never bound. Make it a custom action + accelerator "q" dispatched to Utils.quit(), which emits before-quit so the existing guard (active transfers / unsaved editors, native confirm dialog) runs instead of the OS terminating directly. Handled before the manager-open check so ⌘Q works with the connection manager open too. Co-Authored-By: Claude Fable 5 --- src/bun/index.ts | 6 ++++++ src/bun/menu.ts | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/bun/index.ts b/src/bun/index.ts index 907cc51..123bb79 100644 --- a/src/bun/index.ts +++ b/src/bun/index.ts @@ -245,6 +245,12 @@ ApplicationMenu.on("application-menu-clicked", (event) => { showAbout(); return; } + if (action === "quit") { + // Utils.quit() emits before-quit -> the guard runs (transfers/unsaved). + // Handled before the manager check so ⌘Q quits even with it open. + Utils.quit(); + return; + } // the manager is modal to the main window — don't drive main behind it if (manager.isOpen()) return; rpc.send.menuAction({ action }); diff --git a/src/bun/menu.ts b/src/bun/menu.ts index 02ec9c7..edf6506 100644 --- a/src/bun/menu.ts +++ b/src/bun/menu.ts @@ -42,7 +42,10 @@ export async function applyApplicationMenu(store: ConnectionStore): Promise