Fix Ctrl-Q not quitting on Linux - #1024
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 aclickhandler aren't run in the main process —
buildMenu()insrc/main.jsrewritesevery
clickinto an IPC message that's forwarded to the focused renderer,which then re-runs its own copy of the handler. In the renderer,
app(fromsrc/menu.js) is a stub object ({name, getVersion}) with noquit()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" foractions that must run in the main process:
src/menu.js: change the Quit item fromclick: () => app.quit()toclickMain: 'quit'.src/main.js: addquit: () => app.quit()to theclickMaindispatch mapused by
buildMenu().With
clickMain, the accelerator callsapp.quit()directly in the mainprocess — no IPC roundtrip through the renderer's stub
app.