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

Re: Limiting height of completion menu



 ❦ 19 décembre 2020 12:30 -08, Bart Schaefer:

>> I was wondering if it would have been possible to limit the height of
>> the completion menu. I am using:
>>
>> zstyle ':completion:*' menu yes=long select
>
> This seems to work:
>
> autoload add-zsh-hook
> autoload add-zle-hook-widget
> half-lines() {
>   LINES=$((LINES/2))
> }
> full-lines() {
>   # Force terminal query
>   LINES=0
> }
> comp-lines() {
>   full-lines
>   compprefuncs=( half-lines )
> }
> add-zsh-hook preexec full-lines
> add-zle-hook-widget line-init comp-lines

Yes, it works great! Thanks!
-- 
Program defensively.
            - The Elements of Programming Style (Kernighan & Plauger)




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