Repository navigation
feat(linux): add recent-history cleanup - #33
Merged
melonamin merged 2 commits intoSep 3, 2026
Merged
Conversation
melonamin
force-pushed
the
fix/linux-clear-recent-items
branch
from
September 3, 2026 00:08
05323b3 to
9b4fbf7
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
Linux exposes recently closed sessions and workspaces through Reopen Last Closed Item, but it has no way to clear that persisted history. Upstream macOS provides File ▸ Open Recent ▸ Clear Menu; on Linux neither the command palette nor the control socket calls the existing host-free
WindowLibrary.clearRecentClosedItems()seam.This PR closes parity GAP Б4 by adding Clear Recent Items to the Linux command palette whenever the history is non-empty. The same app-global mutation is available as
agtermctl recent clear/recent.clear, returningresult.affectedwith the number of entries removed.Cause
The storage and mutation already existed in
agtermCore:RecentClosedStore.clear()atomically persists an emptyrecent-closed.jsonstate;WindowLibrary.clearRecentClosedItems()clears the store and refreshes the observed in-memory list.The missing piece was every caller. Linux's palette only exposed reopen, and the public control catalog had no recent-history cleanup command. The existing method was therefore reachable only from the macOS File menu.
Minimal reproduction
Clear Recent Items.Expected (upstream parity): a cleanup action is available and removes the persisted recent-closed history. Actual before this PR: no matching palette action exists, and
agtermctlhas no equivalent command.The new Docker AT-SPI scenario performs this exact flow, reopens the palette to prove the action disappears after clearing, then creates one more recent item and verifies
agtermctl recent clear --jsonreportsresult.affected == 1.Change
Commit
a315bf1—feat(linux): add recent-history cleanup:WindowLibrarymutation.recent.cleartoCommand,ControlDispatcher, the Linux synchronous dispatcher, both app-host adapters, and Linux's app-global controller routing. The response reports the removed entry count through the existingresult.affectedfield.agtermctl recent clearto the sharedagtermctlKitcatalog, so macOS and Linux parse the same command.README.md, the public command reference, the bundled agent skill, and the internal control catalog. The stale numeric command count inREADME.mdis removed per the repository's no-count rule.Scope note
Recent-closed history cleanup only. Reopen behavior, close/undo timing, session and workspace state, keymap syntax, persisted model versions, and libghostty behavior are unchanged. The action uses the existing clear seam rather than adding a second persistence path.
CHANGELOG.mdremains untouched because this is not a release change.Keep-in-sync
Control coverage is included because clearing history is a meaningful user-visible mutation: protocol case, host-free dispatcher, macOS and Linux host actions, Linux synchronous routing, shared CLI parser, protocol/dispatcher/CLI tests, and an end-to-end socket exercise all move together.
The bundled agent skill and
site/commands.htmldocumentrecent.clearandresult.affected. No tree read-back field is added: this is app-global history cleanup rather than per-session mutable state, and the command returns the exact affected count. The keymap and window/workspace/session/pane models are unchanged.Testing
All tests and builds were run inside a purpose-built
swift:6.3.2-nobleDocker image carrying the workflow's GTK4/libadwaita, AT-SPI/Xvfb/Openbox, Mesa, Zig 0.16.0, libghostty, and SwiftLint 0.65.0 dependencies. No Swift tests or app builds were run on the host.swift testinagtermCore: 2574 tests / 97 suites passed, including the new persisted clear, protocol, dispatcher, and CLI parser coverage.scripts/check-linux-core-boundary.sh 834b74a7f78de06e1c4f66c5e24eafccd047ec64: passed.scripts/check-linux-cli-drift.sh: passed.scripts/test-linux-architecture.sh: passed.scripts/test-linux-resources.sh: passed.scripts/setup-linux.sh+scripts/verify-linux-vendor-cache.sh: built and verified the pinned libghostty/resources cache.swift testinagterm-linux: 332 tests / 47 suites passed.swift buildandswift build -c releaseinagterm-linux: passed.AGTERM_ATSPI_SCENARIO=recent-clear scripts/test-linux-ui.sh: passed withOK: palette and control clear recently closed items.swiftlint lint --strict --quiet: clean.git diff --check: clean.