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

Re: segfault on menu-select

On Aug 31,  4:33pm, Philipp Hartwig wrote:
} Subject: Re: segfault on menu-select
} > The difference seems to be whether the zsh/compctl module is loaded.  I
} > don't immediately know why zsh/compctl would be necessary for proper
} > execution of menu-select, but if I add
} > 
} > zmodload zsh/compctl
} > 
} > to the minimal zshrc, I am no longer able to force a crash.

Hmm, and hmm again.  (Yes, I'm hmm-ing at my own previous remarks.)

} I also do not experience any more crashes since adding
} zmodload zsh/compctl
} to my .zshrc. Unfortunately this breaks the menu-select feature in some 
} cases.

I've been fooling with this a bit, and it's not broken; the best I can
describe it is to say it's just not ready to start yet.

} [in a directory with files baz-foo and test-foo and compctl not loaded]
} ph% vi foo<tab><tab><ctrl-o>
} will work out nice and give me the desired menu-selection (or crash).  
} But if I [zmodload zsh/compctl as well], no menu-select will 
} take place anymore.

I can reproduce this.  However, menu-select will take place for me if I
simply add one more TAB:

torch% vi foo<tab><tab><tab><ctrl-o>

This comes down to the code passing through the "else" branch at lines
1013 - 1025 of Src/Zle/compcore.c -- with compctl not loaded, dat.lst
is 0 after runhookdef(COMPCTLMAKEHOOK, ...), but with compctl loaded
dat.list becomes nonzero if we have not made a third attempt to allow
compctl to perform default completion of -foo.

Now, what this has to do with the crash (not) happening after we have
passed (or not) through the compctl hooks, I still don't follow.

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