Skip to content

[Feature] Detach and resume multiplexed sessions without killing them #407

Description

@jvanderen1

Problem

There are times where I want to briefly leave a multiplexed session (tmux -CC, raw tmux, zmx, zellij, herdr) without killing the remote session, then reconnect later (especially when I know network may drop).

Today:

  • tmux -CC already supports graceful self-detach (gateway context menu, Sessions eject, ESC on the gateway), but it is easy to miss when the gateway tab is auto-hidden.
  • ⌘⇧X Detach Other Clients only detaches other tmux clients — not yourself.
  • Other multiplexers have no first-class “leave cleanly / keep session / reconnect” path.
  • Reopening a mux auto-start profile while still attached can feel like spawning an unrelated new window.
  • Missing remote binaries can silently fall through to $SHELL while the UI still looks attached to that multiplexer.

Desired direction

  1. Self-detach is obvious — Tabs → Detach Session / tab context menu from any attached tab, including tmux window tabs when the gateway is hidden. Optional user-assigned keybinds in Settings (no new default chord — avoid stealing macOS Dock ⌘⌥D or anyone’s existing shortcuts).
  2. Works across multiplexers — tmux -CC graceful detach; raw tmux / zellij / herdr native chords; zmx close-client (recommended detach).
  3. Resume, don’t spawn — opening the same mux auto-start profile while a live attachment exists focuses that UI (including zmx: don’t open a second client to the same named session by default).
  4. Post-detach reconnect affordance — short banner (“session keeps running”) with Reconnect; dismissible via ✕.
  5. Honest auto-start — if the multiplexer isn’t on the host, say so and don’t pretend the pane is still that mux.

Inspired in part by iTerm2’s detach / resume journey for multiplexed sessions — worth a shout-out for the UX pattern.

Non-goals / notes

  • ⌘⇧X remains “detach others” for tmux -CC.
  • zmx is one PTY per named session (not multi-window restore like tmux -CC). Intentional multi-attach can still happen via session discovery if needed later.
  • Prefer discoverable self-detach over teaching users to hunt for a hidden gateway.

Status

Contributor PoC in progress locally; manual testing before PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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