Skip to content

fix(linux): bring zmx, Live and remote sessions to macOS v0.33 parity (merge after #45) - #47

Merged
melonamin merged 8 commits into
melonamin:linux-portfrom
n2tr2:linux-zmx-parity-v0331
Oct 5, 2026
Merged

melonamin merged 8 commits into
melonamin:linux-portfrom
n2tr2:linux-zmx-parity-v0331

Conversation

@n2tr2

@n2tr2 n2tr2 commented Oct 1, 2026 •

Copy link
Copy Markdown

Important

Merge after #45. This branch is stacked on #45 (linux-ctrl-tab-parity, 10522e96), so until #45 lands, this PR shows two commits: #45's 10522e96 and this PR's own. Once #45 merges into linux-port, its commit drops out and only this PR's commit remains. The conflicts with #45 are resolved here; in particular, the Ctrl-Tab commit on Ctrl release now belongs only to #45's window-level controller.

Brings the GTK frontend's zmx, Live-session and remote-session behaviour to parity with macOS v0.33.1 (the reference behaviour is unchanged since v0.32), on top of linux-v0.33.1. macOS is the reference and is unchanged. No agtermCore changes.

What changes

Area Before (v0.33.1) After
Exit capture foreground commands captured regardless of the configured exit mode; zmx foregrounds re-listed per pane captured per the configured mode, raw argv kept, unconsumed pending replay preserved; zmx foregrounds read from one fresh bounded snapshot per pass
Launch restore replay policy could drift from the launch's restore decision latched to the launch restore decision; restore.set's pin notice names that mode
Remote presentation a presenter's ask rejection took back more than the ask; held exits of replica panes and overlays ran inside the libghostty callback only the rejected ask is taken back; held exits are delivered a hop later and act only on the surface still in its slot
Covered (follower) panes keys and modifier releases could reach a covered pane's terminal keymap first, then one takeover policy: Ctrl-Tab, leader and app chords keep working, the first other key takes the lead once, and its repeats and release never reach the PTY
Remote rows no remote mark in the sidebar; Ctrl-Tab and popovers used weather-overcast-symbolic bundled agterm-remote-symbolic everywhere, plus a sidebar-only disconnected variant; local launches from a remote row start in a local directory
zmx client kill confirmations misread; attach not validated before ssh confirmations read from stderr; attach validated first
Overlay exit a stale session-overlay exit could close a program or HTML page that had taken the slot the exit closes the slot only if its own surface still holds it
Clipboard a pending read could complete through a surface a lead takeover had already freed (use-after-free) the completion rereads the live surface and skips it when gone

Docs: Linux contracts in .claude/rules/main-loop.md, libghostty.md and agterm-linux/docs/sidebar.md. The skill's zmx list outdated flag and Live-sessions reset advice are scoped to macOS, since Linux answers zmx.reset as unsupported.

Known limits and follow-ups

  • On the pinned libghostty (0ba6250), a clipboard read abandoned by surface teardown leaks its small request state, because no C API frees it without the surface. This is documented in code and in libghostty.md; the fix belongs upstream in libghostty.
  • agtermctl terminfo install from a personal install (install-linux.sh) outside an agterm shell still needs TERMINFO=~/.local/share/agterm/terminfo. The lookup fix lives in agtermCore, so it goes to umputun/agterm instead of this PR.
  • The outdated-daemon flag and a Linux Live-sessions reset are separate follow-ups.

Testing

  • swift test for agterm-linux: 536 tests pass on this branch (on top of fix(linux): bring the Ctrl-Tab switcher to macOS parity #45). The agtermCore suite passed before the rebase, and nothing in it changed since. swiftlint lint --strict reports 0 findings, and scripts/check-linux-cli-drift.sh and scripts/check-linux-core-boundary.sh 8153a64a pass.
  • New unit suites: OverlayExitIdentityTests, LinuxPaneLeadKeyPolicyTests, RemoteHeldExitTests, LinuxForegroundCaptureTests, and others. LinuxPresenterFrameTests now seeds follower roles under v0.33's lead gate.
  • AT-SPI: verify_remote_presentation now covers both origin panes following before any ask, a covered-follower zoom leg (unbound Return held through the takeover, with a PTY marker that a leaked press or repeat would write), an origin-led ask that never reaches the viewer, and the viewer showing the returned ask. Its first run is in this PR's CI. The repeat half of the zoom leg depends on Xvfb autorepeat.
  • Not verified locally: whether fix(linux): bring the Ctrl-Tab switcher to macOS parity #45's window-level controller catches a Ctrl release while the lead cover's button holds the keyboard. The remote AT-SPI scenario or a manual check should cover it.
  • Manual two-host checks are still pending: session-wide ask and overlay handoff, covered-follower zoom keys, remote disconnect held exit, and an HTML overlay refused on a presented session.

🤖 Generated with Claude Code

https://claude.ai/code/session_01P8k6PLdo5pmHZgytbrdevm

- Refuse a cycle under terminal zoom, the dashboard, a modal pick, a
  visible AdwDialog or an open popover, and re-check at commit so a
  modal that arrives mid-hold selects nothing.
- Theme the card from the popover tokens and give the current row the
  sidebar's selection colors instead of a hardcoded dark fill.
- Build the rows once per cycle and reveal the highlighted row's whole
  border box, so it never sits below the fold; the palette and pickers
  share the fixed reveal.
- Place the card 12% down over the terminal area with a 0.2 dim, using
  InterfaceMetrics' panel width and offset clamp.
- Own switcher input with one capture-phase window controller, so
  Ctrl-Tab cycles from the search bar and a rename entry too; Ctrl-Tab
  stays reserved and is consumed even when no cycle begins.
- Cancel a live cycle on window deactivation and popover open.
- AT-SPI scenarios cover zoom, scroll, sessionless, leader, entry and
  deactivation legs.

Claude-Session: https://claude.ai/code/session_01Y6w9aeeiTMG3Kj2ZNbveyq
- Refuse a cycle under terminal zoom, the dashboard, a modal pick, a
  visible AdwDialog or an open popover, and re-check at commit so a
  modal that arrives mid-hold selects nothing.
- Theme the card from the popover tokens and give the current row the
  sidebar's selection colors instead of a hardcoded dark fill.
- Build the rows once per cycle and reveal the highlighted row's whole
  border box, so it never sits below the fold; the palette and pickers
  share the fixed reveal.
- Place the card 12% down over the terminal area with a 0.2 dim, using
  InterfaceMetrics' panel width and offset clamp.
- Own switcher input with one capture-phase window controller, so
  Ctrl-Tab cycles from the search bar and a rename entry too; Ctrl-Tab
  stays reserved and is consumed even when no cycle begins.
- Cancel a live cycle on window deactivation and popover open.
- AT-SPI scenarios cover zoom, scroll, sessionless, leader, entry and
  deactivation legs.

Claude-Session: https://claude.ai/code/session_01Y6w9aeeiTMG3Kj2ZNbveyq
@n2tr2
n2tr2 requested a review from melonamin as a code owner October 1, 2026 15:58
@n2tr2 n2tr2 changed the title fix(linux): bring zmx, Live and remote sessions to macOS v0.32 parity (merge after #45) fix(linux): bring zmx, Live and remote sessions to macOS v0.33 parity (merge after #45) Oct 1, 2026
Ports macOS's zmx, Live-session and remote-session behaviour to the GTK
frontend on linux-v0.33.1 (unchanged on macOS since v0.32). Stacked on melonamin#45.

- Exit capture follows the configured exit mode, keeps raw argv and
  unconsumed pending replay, and reads zmx foregrounds from one fresh
  bounded snapshot per pass; launch replay is latched to the launch restore
  decision, which restore.set's pin notice names.
- A presenter's ask rejection takes back only that ask; held exits of
  replica panes and overlays run a hop after the callback and act only on
  the surface still in its slot. A stale session-overlay exit no longer
  closes a program or HTML page that took the slot.
- Covered (follower) panes route keys through the keymap, then one takeover
  policy: the first other key takes the lead once, and neither its repeats
  nor modifier releases reach the PTY. The Ctrl-Tab commit stays with melonamin#45's
  window-level controller.
- Remote rows get the bundled agterm-remote-symbolic glyph in the sidebar,
  Ctrl-Tab and popovers, plus a sidebar-only disconnected variant; local
  launches from a remote row start in a local directory.
- zmx kill confirmations are read from stderr and attach is validated
  before ssh.
- A pending clipboard read rereads the live surface before completing,
  instead of a pointer a lead takeover may have freed.
- Tests: presenter-frame fixtures seed follower roles under v0.33's lead
  gate; new suites for overlay exit identity, the key policy, held exits and
  foreground capture; the remote AT-SPI scenario covers both origin panes
  following, a covered-follower zoom leg, an origin-led ask and the
  returned ask on the viewer.
- Docs: Linux contracts in .claude/rules and agterm-linux/docs; the skill's
  outdated flag and Live-sessions reset are scoped to macOS.

Claude-Session: https://claude.ai/code/session_01P8k6PLdo5pmHZgytbrdevm
@n2tr2
n2tr2 force-pushed the linux-zmx-parity-v0331 branch from 848f525 to c3171a5 Compare October 1, 2026 16:46
@melonamin
melonamin merged commit 2048320 into melonamin:linux-port Oct 5, 2026
5 checks passed
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.

2 participants