Repository navigation
Conversation
Lets a Windows client quit the focused Mac app with Alt+Q, no Windows key needed (mstsc gates Win-combos when windowed; the macOS Windows App sends Cmd only as a tap). Off by default; config ALT_Q_QUIT=1, plus a Settings toggle in the menu-bar controller. Plain Option only: Option+Shift+Q is deliberately NOT turned into Cmd+Shift+Q (log out); Cmd/Ctrl combos pass through. The gate is a pure, unit-tested decision table (should_alt_q_quit). The tap reuses the Ctrl->Cmd remap's FlagsChanged-on-both-sources pattern and restores the held Option afterwards; the Q key-up is swallowed via consumed_keys. Live-verified on a real client: Alt+Q quits the focused app. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Like the native Cmd+Tab switcher: with Cmd+Tab (or Option+Tab under --alt-tab-switch) still held, Q quits the selected app instead of the frontmost one. The app is dropped from the frozen snapshot (and the HUD), asked to quit via NSRunningApplication.terminate (a normal quit, so save prompts still appear), and the selection moves to the next app, which is activated like a Tab step. Quitting the last app ends the session. No flag: a session only exists while the switcher is held. Previously Q here reached the frontmost app (racing the per-step AX activation) and left the quit app in the switcher's list. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
|
Thanks @antonmos. This now conflicts with #197 changes the same switcher code, so I'll review that one first. Could you rebase this one once #197 is settled? That way you only resolve the conflicts once. I'll review it after the rebase. |
…ps-switch-cf7eef * origin/main: (21 commits) chore(deps): bump libz-sys 1.1.28 -> 1.1.31 (RUSTSEC-2026-0418) (clintcan#243) test(auth_guard): serialize the audit-capturing tests with the ones that emit audit events (clintcan#239) docs(readme): explain controller setup and connecting after a reboot (clintcan#238) fix(stats): count shipped EGFX frames and clear them when the client leaves (clintcan#218) fix(clipboard): keep polling the pasteboard while a format list awaits its answer (clintcan#217) fix(input): close the app switcher when stale modifiers are cleared (clintcan#234) fix(auth_guard): don't count failures after authentication toward lockout (clintcan#233) fix(keyboard_layout): serialize TIS calls so concurrent callers can't abort the process (clintcan#227) chore(deps): bump zstd-safe to 8.2 in the vendored ironrdp-server (clintcan#224) fix(server): read input while a write blocks, and disable Nagle (clintcan#222) fix(capture): apply --max-client-size to the connect-time size too (clintcan#216) feat: read the password from a file with --password-file (clintcan#212) fix(input): drop the scroll backlog the 5-line cap leaves behind (clintcan#210) fix(input): post each modifier change once (clintcan#208) docs: fold hard-won dev lessons into CLAUDE.md and the topic docs (clintcan#202) fix(capture): mirror the main display on a multi-monitor Mac (clintcan#215) docs(readme): add the Homebrew cask install (clintcan#214) feat(input): add --alt-space-spotlight (clintcan#209) perf(capture): retain the flush frame's pixel buffer instead of copying it (clintcan#203) test(input): pure resync_plan + tests for the connection-edge reset (clintcan#192) ... # Conflicts: # README.md # docs/configuration.md # docs/features.md # packaging/config.env.example # src/input.rs # src/main.rs
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.
What
A new opt-in switch,
--alt-q-quit(configALT_Q_QUIT=1, plus an Option+Q quits apps toggle in the menu-bar Settings → App switching), that delivers Option+Q (Alt+Q from a Windows client) to the focused app as Cmd+Q.Why
Quitting a Mac app from a Windows client currently needs Win+Q. mstsc swallows Win-combos when windowed ("Apply Windows key combinations"), and the macOS Windows App forwards Cmd only as a tap, so there was no reliable way to quit. This is the Option-key counterpart to
--alt-tab-switch/--alt-backtick-switch.How
try_symbolic_hotkey(src/input.rs), next to the Option+Tab/Option+` triggers, so it runs before the Ctrl→Cmd remap and layout translation.post_ctrl_as_cmd, then restores the real held-Option state. The Q key-up is swallowed viaconsumed_keys.should_alt_q_quit, covered by an exhaustive decision-table test (alt_q_quit_decision_table).œon US layouts). With it on, Option+Q is lost in every app, including a terminal that uses Option as Meta.Q in the switcher. With Cmd+Tab (or Option+Tab under
--alt-tab-switch) still held, Q quits the highlighted app, as in the native switcher, rather than whichever app is frontmost. The app is removed from the switcher's list (and the HUD), asked to quit viaNSRunningApplication.terminate(a normal quit, so save prompts still appear), and the switcher stays open on the next app. Quitting the last app ends the switcher session. This needs no flag, since the session only exists while the switcher is held. The index logic is a pure function with a test (switcher_quit_moves_selection_to_the_next_app).Docs:
docs/cli.md,docs/configuration.md,docs/features.md, README,packaging/config.env.example.Testing
cargo buildclean;cargo test coord_testspasses, including the new decision-table test./Applications/macrdp.app: Alt+Q quits the focused app, and Q pressed in the Alt+Tab switcher quits the highlighted app (log:app switcher: quit the selected app pid=… sent=true).swift buildingui/fails on this machine's Command Line Tools (SwiftUI@Statemacro plugin not found), with or without this change. The change there is oneToggleline that matches its neighbours.🤖 Generated with Claude Code