Skip to main content

Module ssh_config

Module ssh_config 

Source
Expand description

The hosts the user’s ~/.ssh/config names, for the connection picker (P2 of SPEC_REMOTE_TERMINALS_AND_DURABLE_SESSIONS_2026_10_02.md).

Only names are read, never anything else in the file: a Host alias that is a plain name (no *, ? or ! pattern) is a connection the user can open, and ssh itself resolves everything about it. Include is followed as ssh does, relative to ~/.ssh, with a * in the last part of the path (Include config.d/*), the common form.

Constants§

MAX_INCLUDE_DEPTH 🔒
How deep Include is followed (ssh’s own limit is 16; real configs use one or two levels).

Functions§

expand_include 🔒
The files an Include names: ~/ is the home, a relative path is under ssh_dir, and a * in the last part matches any run of characters there.
hosts
The plain Host names in the user’s ssh config, sorted, each once.
hosts_in
hosts for a given config file, with Include relative to ssh_dir.
is_plain_name 🔒
A name the user can open as it is: not a pattern, and nothing ssh’s own destination check (conn.rs) would refuse.
read 🔒
split_line 🔒
A config line’s keyword and its arguments: Keyword arg ... or Keyword=arg ..., with double-quoted arguments kept whole. None for a blank line or a comment.