Commit fa0fe2f
exe-ssh-config-generator: fix Include line trapped inside Host block
The ensure_include() function checked for the Include line's existence
but not its position. If a user added a Host block above the Include
line, it became scoped to that block (SSH Host blocks end at the next
Host/Match, not at blank lines), so the included config was only
processed when connecting to that specific host.
Now ensure_include() verifies the Include appears before any Host/Match
directive, and moves it to the top if it has drifted inside a block.
Prompt: I ran exe-ssh-config-generator with two keys and "ssh phil-dev"
wasn't picking up the generated config.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent f198220 commit fa0fe2f
1 file changed
Lines changed: 21 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
163 | 175 | | |
164 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
165 | 184 | | |
166 | 185 | | |
167 | | - | |
| 186 | + | |
168 | 187 | | |
169 | 188 | | |
170 | 189 | | |
| |||
0 commit comments