Expand description
Adding a host to the user’s ~/.ssh/config from Remotes, and finding a
host’s Host line there (SPEC_REMOTES_PANE_2026_10_05.md §4.4).
The file stays the one place hosts are defined, so every tool sees a host
added here. AgentMux only ever appends a new Host block at the end (an
Include and earlier Host * defaults still apply to it as before) and
never rewrites an existing entry. It refuses an alias the file already
names, keeps a copy of the file before its first write, and creates the
file owner-only when it is missing.
Every value is checked before it is written: one word, no control
characters, no quotes, so a field can’t end its line and start a directive
of its own (a ProxyCommand, say).
Structs§
- NewHost
- What the Add remote form gives.
Constants§
- BACKUP_
NAME - The copy kept of the config before AgentMux’s first write.
Functions§
- add_
host_ in - Append
hostto the config atconfig(Includes relative tossh_dir). Returns the block written. - all_
host_ 🔒words - Every name any
Hostline in the config (and what it includes) gives, patterns included. - host_
block - The
Hostblock forhost, checked: an alias (required, a plain name) and the optional settings, each on its own line. - locate_
in - The file and 1-based line of the
Hostline namingalias, following Includes. - owner_
only 🔒 - Owner read and write only, as ssh wants its config (Unix; on Windows a new file under the user’s profile is already the user’s).
- user_
paths - The user’s ssh dir and config.
- word 🔒
- One word for an ssh config line: no whitespace, quotes,
#at the start, or control characters.