Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
bug: _ssh_hosts ignores ~/.ssh/config in favor of ~/.ssh/known_hosts
- X-seq: zsh-workers 31161
- From: Christian Höltje <docwhat@xxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: bug: _ssh_hosts ignores ~/.ssh/config in favor of ~/.ssh/known_hosts
- Date: Mon, 18 Mar 2013 11:08:18 -0400
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hello, all!
It appears that in zsh 5.0.2 that the _ssh completion rule it is ignoring ~/.ssh/config in favor of hosts in ~/.ssh/known_hosts.
How to recreate the problem:
1. With a clean ~/.ssh/ directory.
2. Create an entry in ~/.ssh/config like so:
Host foobar
HostName foobar.example.com
3. Now try: ssh f<tab>
4. Note it completes as "ssh foobar"
5. Connect to host.
6. Say 'yes' to ssh prompt to add the host-key to known_hosts
7. Restart your zsh: exec zsh -l
8. Type: ssh f<tab>
9. Notice it completes to: "ssh foobar.example.com" and additional <tab>s won't show the entry from ~/.ssh/config at all.
I expected step 9 to be "ssh foobar" instead.
Some other bugs in _ssh_hosts:
It includes (multiple) '#' as completion targets. Presumably from ~/.ssh/config?
It doesn't understand known_hosts entries that look like: [foobar.example.com]:1234
Workaround: Set 'HashKnownHosts yes' in your ~/.ssh/config -- then nothing will match from ~/.ssh/known_hosts.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author