abtop
abtop copied to clipboard
Jump to session beyond tmux (iTerm2, cmux) via terminal adapter registry
Describe the feature
Extend the Enter "jump to session" so it works outside tmux. Today Enter is a no-op unless abtop runs inside tmux. This adds focusing the terminal that runs the selected agent for iTerm2 and cmux, via a small TerminalJumper registry (one adapter per backend) so further terminals (WezTerm, Kitty, Ghostty, …) can be added easily.
Use case
Many of us run agents in iTerm2 tabs/panes or in cmux workspaces rather than tmux, so the existing jump never fires. With the registry:
- iTerm2 — match the agent process's controlling tty to an iTerm2 session, focus it via AppleScript.
- cmux — read
CMUX_WORKSPACE_IDfrom the process env, thencmux select-workspace --workspace <uuid>. - tmux — existing behavior preserved.
Additional context
- Refactors the inline tmux logic into
src/jump/(one file per adapter). A three-wayJumpAttempt(NotApplicable/Jumped/Failed) makes adapters composable — first applicable wins,NotApplicablefalls through to the next. - iTerm2's first jump triggers a one-time macOS Automation permission prompt.
- Implementation is ready and verified: 15 new unit tests, live-tested on macOS/iTerm2, and the full CI gate (
clippy -D warnings/test/build --release) passes locally on rustc 1.96.0. Happy to open a PR.