-
-
Notifications
You must be signed in to change notification settings - Fork 25.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ssh-config hosts sections for autocompletion #2702
Conversation
…o load/unload keys from the agent (e.g. for use in .zshrc)
@@ -0,0 +1,39 @@ | |||
############################################################ | |||
# Take all host sections in .ssh/config and offer them for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this doing something more than the default Zsh hosts completion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zsh completion does offer hosts that are in the known_hosts file but not hosts from the ssh-config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just confirmed that completion from ~/.ssh/config
is working with a vanilla Zsh install (Ubuntu package version 4.3.17, without OMZ installed of course). Can you confirm that Zsh does not complete from ~/.ssh/config
on your machine, and share your configuration?
I just browsed quickly through Zsh completion code, and I could not find where this is done, but ~/.ssh/config
is definitely parsed for ssh
completion. Will look into it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using zsh 5.0.2 (x86_64-apple-darwin13.0) on Mavericks and can confirm that /etc/hosts and known_hosts are completed but ssh-config host sections are not offered for completion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ncanceill: I think you want the _ssh
completion function, and specifically its _ssh_hosts
helper function which is where it reads the ssh-config file.
I'm also running zsh 5.0.2 on Mavericks, and entries from ssh-config host section names are offered for completion... in some cases. Maybe we should look a bit closely at the default and target behavior before merging this in.
Switching over to #2707 for further comments.
Since you have two separate plugins, maybe you should also have two separate PRs? |
Sorry for the mixed PR. It basically is my second PR and I gave up on trying to find out how to cherry-pick the change to put into the PR. |
I closed the PR and will open two separate ones for the plugins. |
Autocompletion plugin for people who like to make extensive use of ssh-config.
Autocompletion for clouds tool (https://github.com/cristim/clouds).