zsh-workers
 help / color / mirror / code / Atom feed
From: "Christian Höltje" <docwhat@gerf.org>
To: zsh-workers@zsh.org
Subject: bug: _ssh_hosts ignores ~/.ssh/config in favor of ~/.ssh/known_hosts
Date: Mon, 18 Mar 2013 11:08:18 -0400	[thread overview]
Message-ID: <BF5A961A-AD74-459A-83F2-6630D7F17AFA@gerf.org> (raw)

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.

                 reply	other threads:[~2013-03-18 15:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BF5A961A-AD74-459A-83F2-6630D7F17AFA@gerf.org \
    --to=docwhat@gerf.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).