Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Qmail-Scanner-Diagnostics: from hahler.de by f.primenet.com.au (envelope-from <genml+zsh-workers@thequod.de>, uid 7791) with qmail-scanner-2.11 
 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1.  
 Clear:RC:0(188.40.33.212):SA:0(1.3/5.0):. 
 Processed in 0.169406 secs); 17 Aug 2016 19:16:33 -0000
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: *
X-Spam-Status: No, score=1.3 required=5.0 tests=SPF_PASS,T_DKIM_INVALID,
	URI_HEX autolearn=no autolearn_force=no version=3.4.1
X-Envelope-From: genml+zsh-workers@thequod.de
X-Qmail-Scanner-Mime-Attachments: |signature.asc|
X-Qmail-Scanner-Zip-Files: |
Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.hahler.de designates 188.40.33.212 as permitted sender)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thequod.de; h=
	content-type:content-type:mime-version:user-agent:date:date
	:message-id:subject:subject:from:from:received:received; s=
	postfix2; t=1471461380; bh=i2Kkuz96T3h4Npp8NUuEC7q1KvrdsJuwOmIE8
	NOVRC0=; b=rekYEbD+HxOl2e/A/udtBuPcDyLyxdr1Ye0cJMd75/L8x9rw2vI5u
	coRaaCOWC3zTLX01Nv4AZUcjrjlGrdt1Wta9p1VNhKvHCkA0PuEJl+u2H9tKdg4O
	2sClKY2XZentN+gxR/ew09EQkhpaUOzGzd7RDsULgNU8Olcovd7Kww=
To: zsh-workers@zsh.org
From: Daniel Hahler <genml+zsh-workers@thequod.de>
Subject: SSH hostname completion with common suffix and globcomplete inserts
 characters
Message-ID: <705fb246-abcf-176b-d4fa-eb0e01cded05@thequod.de>
Date: Wed, 17 Aug 2016 21:16:17 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.2.0
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="qdJgtIiVKOXV1Wld89F1Bjenv3Q1FQ4l1"
X-Seq: zsh-workers 39054

--qdJgtIiVKOXV1Wld89F1Bjenv3Q1FQ4l1
Content-Type: multipart/mixed; boundary="oAG4bUwBDuP72vfIVnA2FKFpBpmsEgIsX"
From: Daniel Hahler <genml+zsh-workers@thequod.de>
To: zsh-workers@zsh.org
Message-ID: <705fb246-abcf-176b-d4fa-eb0e01cded05@thequod.de>
Subject: SSH hostname completion with common suffix and globcomplete inserts
 characters

--oAG4bUwBDuP72vfIVnA2FKFpBpmsEgIsX
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

When using TAB completion (via expand-or-complete, and "setopt
globcomplete") on a partial hostname where alternatives with a common
suffix exist, the second invocation of TAB will insert some character(s)
that make it fail to complete afterwards.


% autoload -Uz compinit
% compinit
% echo "Host test-05827d88.foo.bar test-6cae9ce0.foo.bar" > ssh_config
% setopt globcomplete

With

% ssh -F ssh_config test-<TAB>

You will get:

% ssh -F ssh_config test-|.foo.bar

Pressing TAB again results in:

% ssh -F ssh_config test-|BR.foo.bar

The characters being inserted seem to come from the "bar".

With ".dot.com" at the end I am seeing "CM" being inserted.

With "Host test-05.dot.com test-6c.dot.com" however "D" is being
inserted.

And with a single TLD (i.e. "test-05827d88.com test-6cae9ce0.com") it
works.

In _ssh_hosts the following is used, which seems to be relevant, since
the inserted characters are uppercased:

    compadd -M 'm:{a-zA-Z}=3D{A-Za-z} r:|.=3D* r:|=3D*' "$@" $config_host=
s

zsh 5.2-dev-1, 062aeca.


Thanks,
Daniel.


--oAG4bUwBDuP72vfIVnA2FKFpBpmsEgIsX--

--qdJgtIiVKOXV1Wld89F1Bjenv3Q1FQ4l1
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iEYEARECAAYFAle0uAEACgkQfAK/hT/mPgDkywCgyzFK0SDlRLJ0DgHJ4/erFy22
EoEAoMkvOaqxyTxrYbD4RQ2rafWXCq9t
=JWzq
-----END PGP SIGNATURE-----

--qdJgtIiVKOXV1Wld89F1Bjenv3Q1FQ4l1--

