Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

ssh host completion: ~/.ssh/config vs /etc/hosts



Hey,

zsh 5.0.8

I just noticed this interesting thing: if certain hosts are listed in
/etc/hosts then the ssh completion will complete _but not list_ hosts in
~/.ssh/config that have the same prefix.

For example, let's take the following entries from /etc/hosts:

172.16.1.2 testme-backup
172.16.1.3 testme-vcenter

Let's assume further that I also have the following in my ~/.ssh/config:

Host testme-nagios
  HostName 172.16.1.4

Host other-master
  HostName 172.16.2.1

Host other-backup
  HostName 162.16.2.2

Now typing »ssh testme-<TAB>« will list testme-backup and
testme-vcenter but not testme-nagios. Typing »ssh testme-n<TAB>«,
however, will compelte to »ssh testme-nagios«.

On the other hand typing »ssh other-<TAB>« will list both entries from
~/.ssh/config, other-master and other-backup. There are no entries in
/etc/hosts that start with other-.

Here's how to reproduce it:

1. Create the appropriate entries in /etc/hosts and ~/.ssh/config.

2. Start a shell and initialize the completion system:

zsh -f
autoload -Uz compinit
compinit

3. Try to complete »ssh testme-« and observe the bug.

Kind regards,
mosu

Attachment: pgpseaSduLBaM.pgp
Description: PGP signature



Messages sorted by: Reverse Date, Date, Thread, Author