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

Re: Rehash after installs



On 14 August 2011 16:46, Gautam Iyer <gi1242+zsh@xxxxxxxxx> wrote:
> On Sun, Aug 14, 2011 at 06:37:52AM +0200, Mikael Magnusson wrote:
>
>>> Another (perhaps nicer) solution would be to "rehash" if command
>>> completion failed, and then retry completion after that.
>>>
>>> This way even with a GUI installation program you'll get current
>>> completion info. I've no idea how to implement it though; so if someone
>>> does it (or has already done it), please let me know.
>>
>> You mean something like
>> zstyle ':completion:*' rehash true
>
> Indeed! Thanks for telling me about this.
>
> The man page however seems to say that a rehash is issued on *every*
> external command completion request. Is it possible to rehash only on
> every *failed* external command completion request.
>
> I guess it doesn't really matter so much as I can't (yet) notice too
> much of a performance penalty.

Sure, but then you would still get incorrect completions as long as
you typed something that can be completed to another command, ie you
installed foobara and had foobaza already, so fooba<tab> would give
you foobaza, while foobar<tab> would give foobara.

-- 
Mikael Magnusson



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