Skip to content

Fix ssh completions for Include lines with comments or ~ paths - #1291

Merged
fdncred merged 1 commit into
nushell:mainfrom
qodelicious:fix-ssh-include-comments
Oct 19, 2026
Merged

fdncred merged 1 commit into
nushell:mainfrom
qodelicious:fix-ssh-include-comments

Conversation

@qodelicious

Copy link
Copy Markdown
Contributor

Fixes #1124

The ssh completer skipped a lot of Include lines. A few things were going wrong in ssh-completions.nu

  • a trailing comment like Include other.sshconfig # extra hosts was read as part of the file name
  • ~ in an Include path wasn't expanded, so Include ~/.ssh/config.d/* got joined onto ~/.ssh and never matched
  • only the first file on an Include line was used, even though ssh allows several
  • a comment after Host github.com # work added # and the comment words as host names

Relative paths still resolve next to the config file like before, and quoted paths with spaces still work.

Tested with nu 0.116.2 and a throwaway HOME with a config that has all of the above. Before the change only github.com, # and GitHub came back. After it the hosts from all four included files show up and the stray # entries are gone. A plain config without any Include gives the same result as before.

Trailing comments on Include and Host lines were treated as part of the
value, ~ in Include paths wasn't expanded, and only the first file on an
Include line was read.

Fixes nushell#1124
@fdncred

fdncred commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

ok, thanks

@fdncred
fdncred merged commit 2b7fd0e into nushell:main Oct 19, 2026
1 check passed
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.

ssh completions not parsing includes

2 participants