zsh-workers
 help / color / mirror / code / Atom feed
* ssh host completion: ~/.ssh/config vs /etc/hosts
@ 2015-08-10 10:33 Moritz Bunkus
  2015-08-10 19:50 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Moritz Bunkus @ 2015-08-10 10:33 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1187 bytes --]

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 #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-08-15  0:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-10 10:33 ssh host completion: ~/.ssh/config vs /etc/hosts Moritz Bunkus
2015-08-10 19:50 ` Bart Schaefer
2015-08-11 12:45   ` Moritz Bunkus
2015-08-11 16:19     ` Bart Schaefer
2015-08-15  0:34   ` Vincent Lefevre

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).