Skip to main content

Module ssh_config_edit

Module ssh_config_edit 

Source
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 host to the config at config (Includes relative to ssh_dir). Returns the block written.
host_block
The Host block for host, 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 Host line naming alias, following Includes.
user_paths
The user’s ssh dir and config.