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

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


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: testme-backup testme-vcenter

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

Host testme-nagios

Host other-master

Host other-backup

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

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

Kind regards,

Attachment: pgpseaSduLBaM.pgp
Description: PGP signature

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