Skip to content

feat: add CMD+Q keyboard shortcut to Exit menu on macOS#4079

Open
sixzjd wants to merge 7 commits into
BeyondDimension:developfrom
sixzjd:fix/macos-cmd-q-exit
Open

feat: add CMD+Q keyboard shortcut to Exit menu on macOS#4079
sixzjd wants to merge 7 commits into
BeyondDimension:developfrom
sixzjd:fix/macos-cmd-q-exit

Conversation

@sixzjd
Copy link
Copy Markdown

@sixzjd sixzjd commented May 12, 2026

Summary

  • Add Gesture = "CMD+Q" to the Exit NativeMenuItem in the macOS application menu
  • This enables the standard Cmd+Q keyboard shortcut for quitting the application

Problem

On macOS, pressing Cmd+Q does nothing because:

  1. DisableDefaultApplicationMenuItems = true removes the standard macOS Quit menu
  2. The replacement Exit NativeMenuItem has no Gesture property set

Fix

One-line change in src/BD.WTTS.Client.Avalonia/UI/App.axaml.cs:

- menus.Add(new NativeMenuItem { Header = Strings.Exit, Command = ReactiveCommand.Create(() => { Shutdown(); }) });
+ menus.Add(new NativeMenuItem { Header = Strings.Exit, Gesture = "CMD+Q", Command = ReactiveCommand.Create(() => { Shutdown(); }) });

Note: The DebugWindow.axaml already uses Gesture="CMD+Q" pattern (line 23), so this is consistent with the existing codebase.

sixzjd added 7 commits May 12, 2026 10:57
The Exit NativeMenuItem was missing a Gesture property, so pressing
CMD+Q had no effect on macOS. Adding Gesture="CMD+Q" enables the
standard keyboard shortcut for quitting the application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant