Skip to main content

Module remote

Module remote 

Source
Expand description

Other hosts’ sessions, in the same list.

A pane holding ssh <host> -t tmux … is a window onto a whole other tmux server, and the agents running in it are invisible to everything else here: they are not this server’s panes and not this box’s processes. But that host has a taimux of its own, and list is a complete answer about it.

The rule that makes this safe is: federate, never reach in. Each host is asked about ITSELF, so the hook state, the screen reading, the versions and the transcripts all stay on the side that can see them, and list is deliberately local-only because it is the wire format. That one rule is what makes a cycle between two boxes ssh’d into each other structurally impossible rather than merely unlikely.

Hosts are DISCOVERED, not configured: whatever the local panes are already ssh’d into is the list. That is not just less setup. A host found this way has a warm ssh ControlMaster by construction (the pane’s own connection), so a fetch is a tenth of a second rather than a handshake; it drops off the list when its pane goes; and it arrives with its jump target already identified, since the pane it was found in IS the way back to it.

Nothing on the refresh path waits on the network except a host with NOTHING cached, which is fetched once per boot so the first picker after a reboot is complete. Everything else is served as it stands and refreshed behind the picker.

Functions§

all_panes
The whole list: this server’s agent panes plus every discovered host’s.
cache_dir
enabled
fetch
Ask one host about itself, and write down what it said.
hosts_cached
The discovered hosts, cached.
index_dump
This host’s index, for another host to read: <pane> \t <blob> per line.
index_fetch
Fetch one host’s index and write it under composite ids.
index_remote
Every discovered host’s index, on its own longer TTL.
pane_host
A row’s pane id is either a local %17 or a remote <host>:%6.
pane_local
remote_taimux
The preamble, for a caller that needs to build its own remote command.
render
One host’s cached reply, turned into rows.
resolve_cur
The pane the picker was opened from, resolved through an ssh window.
rows
Every discovered host’s rows.
ssh
One ssh, bounded, batch-mode, and never reading stdin: -n matters because this runs behind a picker that owns the terminal.
ssh_host
The host an ssh … tmux … argv connects to, or None.
ssh_tmux_panes
host and the local pane it is reached through, for every ssh pane.
ssh_why
Why an ssh failed, in the words the row will carry.
switch_remote
Drive another host’s tmux AS A PEER, then bring the local client to its ssh pane.
tmux_pane_ttys
pane id and tty for every pane on this server, which is what the discovery scan needs and what the caller already has.