zsh-workers
 help / color / mirror / code / Atom feed
* SSH hostname completion with common suffix and globcomplete inserts characters
@ 2016-08-17 19:16 Daniel Hahler
  2016-08-17 19:38 ` Daniel Hahler
  2016-08-17 22:36 ` Bart Schaefer
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Hahler @ 2016-08-17 19:16 UTC (permalink / raw)
  To: zsh-workers


[-- Attachment #1.1: Type: text/plain, Size: 1082 bytes --]

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}={A-Za-z} r:|.=* r:|=*' "$@" $config_hosts

zsh 5.2-dev-1, 062aeca.


Thanks,
Daniel.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

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

end of thread, other threads:[~2016-08-18  5:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-17 19:16 SSH hostname completion with common suffix and globcomplete inserts characters Daniel Hahler
2016-08-17 19:38 ` Daniel Hahler
2016-08-17 22:52   ` Daniel Hahler
2016-08-18  5:32     ` Bart Schaefer
2016-08-17 22:36 ` Bart Schaefer

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