Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Limiting height of completion menu
- X-seq: zsh-users 26237
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Vincent Bernat <bernat@xxxxxxxx>
- Subject: Re: Limiting height of completion menu
- Date: Sat, 19 Dec 2020 12:30:17 -0800
- Archived-at: <https://zsh.org/users/26237>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2020-12/CAH%2Bw%3D7amMkiuWYHdmCemo5sH%2BYAADF_drF%3DiHJ7Wpypv_zGwoQ%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-ot1-f44.google.com) smtp.remote-ip=209.85.210.44; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CY3PbYib5sVSX/9Lc/pDWsOLabG7GbqhyAVp69tMuP4=; b=EtU+d9DdQY93aWuMg4AvMUBb4CoT6GrfyCiOSbtkPO1u/qjBDB2rc3Ba/f2QzSG+6G nMvdDeXXCmVw3Av/UQJGH28F4iPWGUZlQPa9yUV6MvUHCjIIlP5gILjJ1NPLPG0CYWQz Bjl1mdTvBsz27Nh7TwxlXUCi6+jUMBda7/m/udfT6wwj14R8U2N0SO2KljtaRL7v1xpu SqcBu/SkQCVB2NpCfv8d095VUBeQI/YOcirSBQiKoxrYygSo5cp+tWbY0at0ioVwyUNf /9tU9AB3MGTR8DoJQsFplbG8uemfjEEwKuFsRoxAmSE90FdutygS+XJ8FI/BgTRfdh2s HQ0w==
- In-reply-to: <m3tushaaq2.fsf@luffy.cx>
- 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>
- Sender: zsh-users-request@xxxxxxx
On Sat, Dec 19, 2020 at 10:53 AM Vincent Bernat <bernat@xxxxxxxx> wrote:
>
> 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
However, there is an odd side-effect in that the command line is
temporarily garbled if you are NOT using menu-select and the "do you
wish to see all X possibilities" prompt is printed. It fixes itself
as soon as you answer yes/no, but it's curious that it happens in the
first place.
Note it does not work to use comppostfuncs=( full-lines ) ... the
comppostfuncs are run before menu-selection determines the screen
size.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author