Expand description
SSH terminals (P2 of SPEC_REMOTE_TERMINALS_AND_DURABLE_SESSIONS_2026_10_02.md).
A pane on an SSH connection runs the system ssh in its PTY (spec §3.1):
the user’s own ~/.ssh/config, keys, agent and known hosts apply, and
ssh asks for a password, a passphrase or a new host key in the terminal
itself, where the user answers it. The askpass bridge (§5.3), which an
agent’s non-interactive use needs, comes later.
Enums§
- Control
- What to ask a shared connection (
ssh -O).
Constants§
- EXIT_
CONNECTION_ FAILED sshexits 255 when it could not connect, could not authenticate, or the connection dropped; any other code is the remote command’s own.
Functions§
- binary
- The
sshto run: the first onPATH, then (Windows) the OpenSSH client Windows installs, which an inheritedPATHcan lack. - binary_
for_ user binaryfor the user’s own interactive ssh pane, whose prompts are the user’s to answer in it: a native client is preferred whatever its version (Windows 10’s inbox OpenSSH is 8.1), still for its name resolution.- connection_
lost - Whether
sshending withcodemeans it had no connection, or lost it, rather than that the remote shell ended (exitincluded). A session on a shared connection that was closed or died ends this way too. - control
- The
ssharguments askingdest’s shared connection indirtoop: the same socket a pane’slaunchshares. - control_
dir - Where
ControlMastersockets go (macOS and Linux; Windows’ OpenSSH has no connection sharing): a private, owner-only directory, since anyone who can open a socket there can use the connection.None(no sharing; ssh still connects) if it can’t be made so, or a socket in it would be too long. - launch
- The
ssharguments for a pane.control_dir, on macOS and Linux, is where connection-sharing sockets live (ControlMaster), so a second pane on the same connection reuses the first one’s and asks for nothing. - launch_
exec - The
ssharguments for one command run without a terminal (an agent’sShell):launch’s, with-Tin place of-tt, since its output is read, not a session shown. - lost_
message - What the connection’s status says when a pane’s
sshlost it. - lost_
note - The line a plain SSH pane shows, under ssh’s own reason, when it has no connection: the pane stays, and Enter starts ssh again.
- missing_
binary_ message - What to say when there is no
ssh, with how to get it on this platform. - pane_
lost_ connection - Whether a pane’s
ssh, ended withcode, lost its connection (or never had one).stopped_by_srv: srv ended it itself (the pane closed, or restarted), and ssh then exits 255 too (closing its pty does, and a session on a shared connection does on SIGTERM), which is no lost connection. - quote
- One word for a POSIX shell: single-quoted, with
'written as'\''. - quote_
path quotefor a remote path, leaving a leading~or~/unquoted so the remote shell expands it to the remote home (OSC 7 and users write it).- remote_
command - The command line
sshhands to the remote user’s login shell: the pane’s command, run incwdwhen one is set, or for a plain pane with a cwd, the login shell started there.Nonefor a plain pane with no cwd: ssh then starts the login shell itself. - set_
pane_ env - Name the pane in
launch’sSetEnvtoo (AGENTMUX_BLOCKID), so a host that accepts it (AcceptEnv AGENTMUX_*) lets the pane’s stats badge find its shell there (PaneProcs). Dropped quietly by any other host, like the rest of thatSetEnv. A block id is AgentMux’s own UUID; anything with another character is left out rather than quoted. - shared_
control_ dir control_dirfor this srv’s channel: where everysshit runs to a host (panes, agents’ commands, the helper, files) shares one connection.Nonewhere ssh can’t share connections, and then there is nothing to ask-O.