feat(completion): support for SSH hosts#195
feat(completion): support for SSH hosts#195Sporif wants to merge 1 commit intonix-community:mainfrom
Conversation
7c036f7 to
2b95fc7
Compare
|
While I do appreciate the time taken for this, it does seem like an awful lot of code to have to introduce that we would have to maintain ourselves, just for SSH config parsing. I'm open to including it for now, but we may want to pivot to a more battle-tested approach later on because I am sure we may run into issues in the future when users with more complex SSH configurations start to use it. Also, FYI there is already precedent to use forked packages here, which I use for |
2b95fc7 to
b7a2904
Compare
|
Ok, you convinced me to create a fork for |
b7a2904 to
5f0c030
Compare
Retrieve the hosts from the hosts file, SSH config files, and SSH known_hosts files. Also add a setting to allow users to disable hosts file completion in case it contains too many hosts.
5f0c030 to
9976d3e
Compare
Retrieve the hosts from the hosts file, SSH config files, and SSH known_hosts files. Also add a setting to allow users to disable hosts file completion in case it contains too many hosts.
The implementation copies
_comp_compgen_known_hosts__implfrom bash-completion as much as possible. But some parts are intentionally left out, e.g.ssh2config paths,avahi-browse,ruptime. I believe it also improves upon the ssh config parsing since the lists of hosts fromnixos-cliis more correct, at least on my system.I would use the ssh_config pkg but I'm not sure how to recursively get all hosts, due to some unexported fields. It's probably why a PR was made to add a GetHosts function. So instead of using a fork I have implemented partial ssh config parsing, which has been very fun.
Closes #186.