Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Limiting height of completion menu
- X-seq: zsh-users 26243
- From: Vincent Bernat <bernat@xxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Limiting height of completion menu
- Date: Sat, 19 Dec 2020 23:24:29 +0100
- Archived-at: <https://zsh.org/users/26243>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2020-12/m3a6u9a0yq.fsf%40luffy.cx>
- Authentication-results: zsh.org; iprev=pass (out1-smtp.messagingengine.com) smtp.remote-ip=66.111.4.25; dkim=pass header.d=luffy.cx header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=pass header.from=luffy.cx; arc=none
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=luffy.cx; h=from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type:content-transfer-encoding; s=fm2; bh= 6RFYpsPIwwcEhUJwhWRO8hpXdYipXaiHEjOHpKe6MMo=; b=E7fZ9hC77TGv6/px TNpEv0PAej2XZn4BCUyf0N2WhJHb6z9FwAugVPxt8QxnDoi9STgZRLYlceYhPcsc 0K67n6mWsOBZEYSqEiPG1ol5v6Vdsv13a0h6dWazy73qGwuGWeiJrFShQPf3DnZ5 TbJtZepLcFT55/G3vPwNPXsJxAZqCe8JvBJ+TR04sq5CuVbpb117TodWX9YFqLu8 HLJ86W01lQsQygTinB3HXMK+5d9wXOotOSXiT1GtBQISc8Vt4FZR/XuEpNzIIp+C LfOMpD3yiU/CFFRNKFumaKCuJlqrEnD9CYbTFQMkz0QcEHxa1vCUcbc1CVEwITJL 0tq+7A==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=6RFYpsPIwwcEhUJwhWRO8hpXdYipXaiHEjOHpKe6M Mo=; b=GTA52mrZOVwFvOp6Vs8OKGMcyxuk15TJFRdjVKaLTwX2dHkT1iHkxdT4Q u123bCE3Rrq7SGj355cX/XDcgvKS3Zw336QSmEQWXLINTOOp5kaNQHndmXTFQH+3 1WY9Vru/z6nNB3Z3vQHaoUmTYzKX+KMCbxPcL5Yll4ITLsynXitZqE70KAyq0jug Of+nSFDj8NP4tpJnSNlmbAumFt8e2X5Xot2dd0o0qiflHg5Xac0LL6UGyMxqvoAY wEpROk0FBrkY+voBDTOWiYfefuVD85MKnnQCpBE4RKJ2YAzHdBSJuK2Sa6035mIR uQYi11swirdPQzk8EuaD4LTOxfTCg==
- In-reply-to: <CAH+w=7ZGhXHd0ua_AXBdOr1cJs4qrkd56JYiro3MaOErXLoHpg@mail.gmail.com> (Bart Schaefer's message of "Sat, 19 Dec 2020 14:15:30 -0800")
- List-archive: <http://www.zsh.org/sympa/arc/zsh-users>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-users.zsh.org>
- List-owner: <mailto:zsh-users-request@zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-users>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-users>
- References: <m3tushaaq2.fsf@luffy.cx> <CAH+w=7amMkiuWYHdmCemo5sH+YAADF_drF=iHJ7Wpypv_zGwoQ@mail.gmail.com> <m3lfdta330.fsf@luffy.cx> <CAH+w=7aT5+Tc8szJHu2mwAyEOvO0sQ2F3T0N3UMTmtpghU9UOg@mail.gmail.com> <m3h7oha1i8.fsf@luffy.cx> <CAH+w=7ZGhXHd0ua_AXBdOr1cJs4qrkd56JYiro3MaOErXLoHpg@mail.gmail.com>
- Sender: zsh-users-request@xxxxxxx
❦ 19 décembre 2020 14:15 -08, Bart Schaefer:
>> It also resets $LINES in my case.
>
> Yeah, I just noticed that. Sometimes you have to save ZLE from itself.
>
> half-lines () {
> print -n $(tput sc)
> LINES=$((LINES/2))
> print -n $(tput rc)
> }
It doesn't seem to fix the garbled non-select completion.
This simpler solution seems to work for me:
zstyle -e ':completion:*' menu 'reply=(yes=$((LINES/2)) select)'
_vbe_half-lines() {
LINES=$((LINES/2))
}
_vbe_full-lines() {
# Force terminal query
LINES=0
}
add-zsh-hook preexec _vbe_full-lines
add-zle-hook-widget line-init _vbe_half-lines
Its scope is wider than completion, but it doesn't seem to break
anything for me.
--
10.0 times 0.1 is hardly ever 1.0.
- The Elements of Programming Style (Kernighan & Plauger)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author