Skip to content

Fix Ctrl-Q not quitting on Linux - #1024

Merged
apetresc merged 1 commit into
SabakiHQ:masterfrom
kevinsung:quit
Jul 1, 2026
Merged

Fix Ctrl-Q not quitting on Linux#1024
apetresc merged 1 commit into
SabakiHQ:masterfrom
kevinsung:quit

Conversation

@kevinsung

@kevinsung kevinsung commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #1023

Disclaimer: This PR and the following description were generated by Claude Code. I tested that the fix works on Linux, but I didn't test whether it changes behavior on other operating systems.

Fix Ctrl+Q not quitting the app on Linux

Summary

Ctrl+Q (the Quit accelerator) silently did nothing on Linux and Windows.

The Quit menu item used click: () => app.quit(). Menu items with a click
handler aren't run in the main process — buildMenu() in src/main.js rewrites
every click into an IPC message that's forwarded to the focused renderer,
which then re-runs its own copy of the handler. In the renderer, app (from
src/menu.js) is a stub object ({name, getVersion}) with no quit() method,
so the call threw/no-opped and the app never quit.

macOS was unaffected because the Quit item is spliced out of the File menu and
replaced with the native {role: 'quit'} there.

Fix

Route Quit through clickMain, the existing mechanism used by "New Window" for
actions that must run in the main process:

  • src/menu.js: change the Quit item from click: () => app.quit() to
    clickMain: 'quit'.
  • src/main.js: add quit: () => app.quit() to the clickMain dispatch map
    used by buildMenu().

With clickMain, the accelerator calls app.quit() directly in the main
process — no IPC roundtrip through the renderer's stub app.

@apetresc
apetresc merged commit 5d824d6 into SabakiHQ:master Jul 1, 2026
2 checks passed
@kevinsung
kevinsung deleted the quit branch July 3, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Ctrl+Q doesn't quit on Linux

2 participants