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

Re: PATCH: completion or'ing and grouping

Sven Wischnowsky wrote:
> > Second, there seems to be a problem with menucompletion set.  It now
> > pauses when it gets to an ambiguous completion, and only cycles
> > through the next time you hit tab --- in other words it seems to have
> > turned into the normal automenu behaviour.
> The patch below fixes this.

Thanks, that's now fine.  The next thing I've noticed so far with this
patch, before I try the next one, is that when attempting an ambiguous
completion at the bottom of the screen the cursor moves up a line,
even if there isn't anything to be displayed.  It seems to be pretty
much independent of completion options, happening any time there's more
than one possibility for completion.

The next is that with these options:

noalwayslastprompt    off
noautolist            on
noautomenu            on
nolistambiguous       off
menucomplete          off

% mkdir tmp
% cd tmp
% touch foo.{a,b,c}
% compctl -D -f
% echo foo.<TAB><TAB><TAB><TAB>  ->  foo.xx
       ^^^^typed by hand, but it doesn't seem to matter

so I get two spurious xx's with the cursors after them.

With the same options, if I type `echo zsh<TAB><TAB><TAB>' in the zsh
Src directory (where there is no file zsh, this makes a difference)
the shell crashes with the first part of the backtrace as so:

#0  0xd000db50 in strlen ()
#1  0xd1002bf4 in inststrlen (
    str=0x7a736878 <Address 0x7a736878 out of bounds>, move=0, len=-1)
    at zle_tricky.c:1346
#2  0xd100c430 in do_ambiguous () at zle_tricky.c:3835
#3  0xd1005108 in docompletion (
    s=0x200ced08 <Address 0x200ced08 out of bounds>, lst=0, incmd=0)
    at zle_tricky.c:1992
#4  0xd1000730 in docomplete (lst=0) at zle_tricky.c:744
#5  0xd0ffee9c in expandorcomplete () at zle_tricky.c:346
#6  0xd0ffa200 in execzlefunc (func=0x7a736878) at zle_main.c:590

gdb shows that firstm->psuf has an illegal value here:

	if(suflen && !atend)
	    inststrlen(firstm->str + strlen(firstm->str) - suflen, 1, suflen);
	if (firstm->psuf)
	    inststrlen(firstm->psuf, 0, -1);
	if (brend && *brend) {
	    cs -= brsl;
	    inststrlen(brend, 1, -1);

in do_ambiguous().  In fact, the whole of firstm seems to be illegal.
At other times, I have had it insert another 'zsh', giving 'zshzsh',
presumably related to the same bug.

Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarotti 2, 56100 Pisa, Italy

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