Skip to content

Improve SSH config parsing to handle edge cases and includes#89

Draft
Codex wants to merge 2 commits into
mainfrom
codex/handle-ssh-config-edge-cases
Draft

Improve SSH config parsing to handle edge cases and includes#89
Codex wants to merge 2 commits into
mainfrom
codex/handle-ssh-config-edge-cases

Conversation

@Codex

@Codex Codex AI commented Feb 28, 2026

Copy link
Copy Markdown
Contributor

SSH config parsing was missing edge cases (multi-pattern hosts, global defaults, includes, identity path normalization), leading to incomplete sync coverage.

  • Parsing: Switched to ssh_config decoding, collecting all KVs per host (including Host *) and expanding multi-pattern entries into distinct hosts. Recurses through Include directives with ~ and glob handling while avoiding cycles.
  • Identity paths: Normalizes IdentityFile entries relative to the user home (POSIX/Windows) for consistent storage and sync.
  • Tests: Added coverage for globals, multiple host patterns, identity normalization, and include resolution.

Example:

hosts, _ := parseConfigFile("~/.ssh/config", homeDir, map[string]bool{})
// hosts now include Host *, foo, bar, baz with normalized IdentityFile and merged values
Original prompt

This section details on the original issue you should resolve

<issue_title>Handle edge cases in ssh config parsing</issue_title>
<issue_description>There are likely edge cases in the ssh config parsing that are not currently being taken into account. We should write code to ensure we are syncing the whole config, including currently "unsupported" parts. Figure out all the edge cases of what ssh config files can have and lets make our parsing better</issue_description>

Comments on the Issue (you are @codex[agent] in this section)

@Codex Codex AI changed the title [WIP] Improve ssh config parsing to handle edge cases Improve SSH config parsing to handle edge cases and includes Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle edge cases in ssh config parsing

2 participants