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

Re: Completion strangeness



Kyle Rose wrote:
> This relates to zsh 4.2.5's ssh command line completion.  I don't know
> if this problem exists in earlier versions.

This is unrelated to the bug Bart pointed to. I can't reproduce what you
show exactly but I have isolated this down to what is undoubtably a bug.
Whether this is the problem you're having, I'm not sure.

>   krose@jihl ~% ssh krose@xxxxxxxxx
> 
> with the cursor over the second ".".

I always found that sort of stuff (filling in characters to the right of
the cursor) a bit weird. I've seen it before and assumed Sven meant it
as a feature. Maybe he didn't.

We can cut this down to a minimal setup to see problems:

zsh -f
autoload -U compinit; compinit
zstyle ':completion:*:::' _complete
_try() {       
compset -P '*@'
compadd -M 'r:|.=* r:|=*' \
        yupa-dmz.valley-of-wind.krose.org \
        yupa.krose.org yupa.valley-of-wind.krose.org
}
compdef _try t

Now compare the following:
% t y<tab>
  -> t yupa_
% t kr@y<tab>
  -> t kr@yupa_
% t kro@y<tab>
  -> t kro@xxxxxxx

Where _ is the cursor.

Patterns like '???' and '????' in compset also work. If compset has
removed four or more characters, we get the separator character (.)
inserted. So the problem is in the C code.

Oliver



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