Skip to content

Using tmux

You need tmux on the host, on PATH — or a path in the connection form’s Custom tmux Path field. Nothing else. The hook install below is optional and separate.

If tmux is missing the session degrades instead of failing: a plain SSH single pane plus a banner reading “tmux not found on this host — plain SSH session.”, and an Install tmux action that shows the command for your package manager and runs it only when you tap it. Moshpit never silently swaps in a different multiplexer — tmux and herdr hold unrelated sessions. A custom tmux path skips the check entirely, since the probe only walks PATH.

Moshpit doesn’t shrink tmux’s own text UI onto a phone. It attaches as a control client — tmux -CC, the same control mode iTerm2 uses — and renders the result itself. On connect it writes exactly this:

Terminal window
tmux set -g history-limit 50000 2>/dev/null; tmux -CC attach

attach with no -t means your most recent existing session. Moshpit never runs tmux new on its own. With no sessions on the server you get an empty state saying so, and a Create Session button you press yourself.

Discovery is three commands on the same channel, re-run whenever the tree changes. -a is every session on the server — that’s why the home screen can show several expanded at once:

list-sessions -F '#{session_id} #{session_attached} #{session_name}'
list-windows -a -F '#{session_id} #{window_id} #{window_index} #{window_layout} …'
list-panes -a -F '#{pane_id} #{window_id} #{pane_index} … #{pane_current_command}'
  • Attach has a 22-second deadline. If tmux never confirms, the home card reads stalled — “Attach didn’t complete — tmux never confirmed.” — with a retry. SSH itself is still alive; it’s the tmux handshake that didn’t land.
  • Control mode cannot run over mosh. Mosh sends screen diffs, not a line-framed protocol. On mosh + tmux, Moshpit renders tmux’s ordinary full-screen UI over mosh and opens a second, sidecar SSH connection running -CC just to feed the breadcrumb and the sheets. No SSH, no native sheets — you get a bare tmux attach.