Repository navigation
fix(linux): dispatch window key actions - #31
Merged
melonamin merged 1 commit intoSep 3, 2026
Merged
Conversation
melonamin
force-pushed
the
fix/linux-window-key-dispatch
branch
from
September 2, 2026 23:52
2e436a2 to
b35cdae
Compare
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
On Linux,
rename_windowanddelete_windoware valid built-in keymap actions, but assigning either action inkeymap.confproduces a shortcut that is consumed without doing anything. The same window rename and delete operations already work through the GTK palette/context-menu dialogs and through the control API; only the built-in key dispatch path is missing.This PR routes both mapped actions through the current Linux window controller's existing dialog paths. It restores upstream macOS behavior without adding default chords: both actions remain mappable-only, matching
BuiltinAction.defaultChord == nilupstream.Cause
AppController.dispatchBuiltinis the exhaustive Linux adapter fromBuiltinActionto GTK behavior. ItsrenameWindowanddeleteWindowcases were explicit no-ops:handleKeystill returnedtrueafter calling this dispatcher, so the configured chord was consumed and could not fall through. The Linux UI already had the required implementations inAppControllerContextMenus.swift:renameWindowDialog(_:)andconfirmDeleteWindow(_:).Minimal reproduction
Add explicit mappings to
<configDir>/keymap.conf, for example:Reload the keymap.
Press either mapped chord in an agterm-linux terminal window.
Expected (upstream parity):
rename_windowopens the pre-filled Rename Window dialog;delete_windowopens the destructive Delete Window confirmation when another library window exists.Actual before this PR: the chord is consumed and nothing appears.
Neither action gains a shipped default shortcut. They run only when the user explicitly maps them, as on macOS.
Change (1 commit, 1 implementation file + 1 UI test file)
Commit
fix(linux): dispatch window key actions:agterm-linux/Sources/AgtermLinux/KeymapDispatch.swift— replaces the two no-op switch arms withrenameWindowDialog(windowID)andconfirmDeleteWindow(windowID). Using the handlingAppController'swindowIDscopes the action to the exact terminal window that received the key event, rather than whichever global window pointer happened to be active.agterm-linux/tests/atspi_smoke.py— adds the isolatedwindow-key-dispatchscenario. It writes explicit mappings for both mappable-only actions, creates a survivor window, sends real X11 keyboard input to the original window, drives the existing dialogs through accessible pointer input, verifies rename/delete via control read-back, and confirms that deleting the target leaves both the survivor window and the application running.No new action implementation or dialog is introduced; key dispatch reuses the same GTK paths already used by the palette and context menus.
Scope note
Linux built-in key dispatch only.
BuiltinAction.defaultChord,BuiltinAction.linuxDefaultChord, keymap parsing and conflict resolution, window persistence, dialog wording, palette behavior, and control protocol behavior are unchanged.In particular, this PR does not add default chords for
rename_windowordelete_window. Adding them would diverge from upstream macOS, where both actions are mappable-only.Keep-in-sync
Control API already covered:
window.renameandwindow.deletealready expose these mutations, including existing dispatcher, CLI, protocol tests, and window-list read-back. This PR fixes one missing GUI/keymap caller and does not add a new capability.The keymap format and the window/workspace/session/pane model are unchanged. The bundled agent skill command catalog and website command reference therefore need no update. No new setting or release behavior is introduced, so
README.mdandCHANGELOG.mdare intentionally unchanged.Testing
agtermCoreinswift:6.3.2-noble: 2570 tests / 97 suites passed. The command was chained with&&into the succeeding Linux-package test and build stages.swift build --product AgtermLinux— passed.swift build --product agtermctl-linux— passed.AGTERM_ATSPI_SCENARIO=window-key-dispatch scripts/test-linux-ui.sh— passed withOK: mapped rename_window and delete_window drive current-window dialogs.swiftlint lint --strict --quietwith Swift 6.3.2 / SwiftLint 0.65.0 — clean.python3 -m py_compile agterm-linux/tests/atspi_smoke.py— passed.git diff --check— passed.2e436a2: Detect changes passed, Unit tests (Linux) passed, SwiftLint (Linux) passed, and Build app (Linux GTK) passed, including the complete GTK AT-SPI smoke suite. Cookbook checks skipped because this PR changes no cookbook inputs.