Skip to content

Jump to session beyond tmux (iTerm2, cmux) via terminal adapter registry #137

Description

@Valgard

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_ID from the process env, then cmux select-workspace --workspace <uuid>.
  • tmux — existing behavior preserved.

Additional context

  • Refactors the inline tmux logic into src/jump/ (one file per adapter). A three-way JumpAttempt (NotApplicable / Jumped / Failed) makes adapters composable — first applicable wins, NotApplicable falls 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions