charmbracelet / wishlist

The SSH directory ✨

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for the Include directive in the SSH config file

curio77 opened this issue · comments

wishlist should support the Include directive in the SSH config file, used to incorporate separately-held SSH configurations (typically, host definitions). Otherwise, hosts defined this way won't be considered and listed in wishlist.

this is already supported...

Huh? Doesn't work for me. 🤔

Just checked again, nope, neither with full (relative) paths nor with wildcards (e.g., Include config.d/*). This is with the latest version of wishlist installed via go install github.com/charmbracelet/wishlist/cmd/wishlist@latest. I don't see the hosts defined in the separate files in the list presented by wishlist (but they work, of course, with ssh on the command line).

what does the logs say?

can you provide a minimal reproducible example?

I just checked here: it is working, and there are tests enforcing it works. So, if it isn't for you, probably there's something different in your configs...

Alright…

Trying to do this, I think I've identified the issue. ssh takes the Include directive as relative to the location of the file, i.e., relative paths in ~/.ssh/config are resolved relative to ~/.ssh. wishlist, OTOH, resolves relative to the CWD, hence it works when I run it from the ~/.ssh directory but not otherwise. This explains the observed and reported behavior, and I think that's a bug.

Addendum: And even so, wildcards don't work, it only works with explicit names, but not with something like config.d/*, even if I run wishlist from ~/.ssh or make the wildcard path absolute.

can you check #263?