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

Re: Is it possible to limit the height or rows of menus?



On 4/5/20, Dave Woodfall <dave@xxxxxxx> wrote:
> On 2020-04-05 16:00,
> Dave Woodfall <dave@xxxxxxx> put forth the proposition:
>> On 2020-04-05 15:38,
>> Dave Woodfall <dave@xxxxxxx> put forth the proposition:
>> > zsh 5.6.2
>> >
>> > When using menu select with a command that has many options, all rows
>> > in the terminal may be filled, and the context is lost (i.e. any
>> > previous commands and their output disappear past the top of the
>> > terminal, so needing to scroll back up to see them.)
>> >
>> > What I would like to do is limit the number of rows.
>> >
>> > I tried doing something like:
>> >
>> > LINES=10 grep -<tab>
>>
>> And typically, after asking a question we find the solution
>> ourselves.  I defined a custom function that contains:
>>
>> LINES=15 zle complete-word
>
> I spoke too soon.
>
> It looks using a custom function bound to the tab key causes some
> problems, even without setting LINES.
>
> Now when I get to the end and cycle back to the top, the prompt goes
> up and overwrites the previous line.
>
> This is what I'm using:
>
> zle -N _vi-tab
>
> _vi-tab() {
>   LINES=15 zle complete-word
>   }
>
> bindkey '\t' _vi-tab
>
> Any ideas?

Normally you would use zle -C for custom completer functions, but I
don't want to get involved further than this :).

-- 
Mikael Magnusson



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