From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21605 invoked from network); 19 Dec 2020 20:30:50 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 19 Dec 2020 20:30:50 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1608409851; b=oZQ64rJeIyzgkW2F1Jy+LYjhpnsJFmRfaeOvrv4NBg/aYSOytBVrOOBtW6Si5IkGKnXip3HY+s 9GF/HEBAt3V8JNNHhM6augQNS5izWRK4dSmWwTzLx+JEhMGb5WWIgZpxonHd64+4/QWCPVk/LJ 3vx/xapnnV7KOEAkjbprrA1xTQOBtVlOzDVuo8Ep9XnDHNgf03OIyucAUnFDiFXfou3Aw5MBae WbPL2Drnw8Sws4Y9V+zM5UUPCeI3MiBGIH9Ev1Odc2zr2GDscJiZqiv8xcxnO5KBatiu4fHb2X o+e8YmFqfBX8D9LIq/CSmwlyYRUH7R4kyvkcTZyGmGyqZw==; ARC-Authentication-Results: i=1; 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1608409851; bh=a8tQG31towsRUySdYW2Dg1J/CUoGZLFBcDksAU5myHU=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=L1WXAKPw2hwCuGFHTnpRS8E8p4JiwNlfMZejO5B2MEnXbX76jYLsSaDhiFCuP/Eq7ZgV3yhDz8 W2qk+E1T7vgfAcC8fLsyzrc5uJjrrA/QrrY0TjoKRB9TLU567z+4zsLs6r2+vXBwGi8JjOLFXn WMIC8UecH2Ufgk9r0ZsyLHuamNEMk03XrSoX6bnxyYuOmI8vK6SF5VTPfyev7LCcdwCGJU6FMM 8DDBvErSaWCealwYGn9OkDHTqfrTIScOROdHLv/eGPfGsU7o9ekqy9Q9eEzaA8oxyl2b+HgluH MgKgeNECCyM1CT5z0apOYmbRJlECsRbS3EveT3q0lHWNtw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=CY3PbYib5sVSX/9Lc/pDWsOLabG7GbqhyAVp69tMuP4=; b=QBqAnmrvsSQXiewTpJXiQk0ZJJ ZQvqH8y4xc9gYzpG65duLkQUxF4agss2OAId94UW7BfWDqM3673tCcSRRUfPB3ktjlmP6XuodXPsS Qdt52fpDzSQwd4i0/DMO80pHMiI3SZ1573l0/HOkIeV2fQpBNHbQz5cpw+1jQR0fOLgDUvEL3lSAL fPd7S69FVVIv62Xs/iiWvTUrK7ZxJvozUXFWBIJIY0tL8B3YjL0BMlvnY159n/Ue/tQWWGmIsBerg p9R+y/TN8YWw91oYCDeshm4faTvxlpyc+VqzaLfBcOPW3WZfLUhXzAJILGsclCIvQ1brEiYbpq3d7 QVim6h3Q==; Received: from authenticated user by zero.zsh.org with local id 1kqisM-0001Sg-Rb; Sat, 19 Dec 2020 20:30:50 +0000 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 Received: from mail-ot1-f44.google.com ([209.85.210.44]:45875) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kqis1-00016I-IF; Sat, 19 Dec 2020 20:30:30 +0000 Received: by mail-ot1-f44.google.com with SMTP id h18so5323892otq.12 for ; Sat, 19 Dec 2020 12:30:29 -0800 (PST) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CY3PbYib5sVSX/9Lc/pDWsOLabG7GbqhyAVp69tMuP4=; b=E4zK1jWM908tEintK9QPSxM9kMuYm6ORuvUGrlet5ckOOGEVOeUVp/OU4Mo1+bJetR nWXcSZ8zqxmysIH0tSTvQO8XloiVgRu/8q2bBOPhYP9HsCsp5q62cviIm/nm9VZOZ2BS 4YY0RUelxVKk1x6Wf/bjBzBXNVTRO3XacbFZ6IswckTi5lYLKqZh5o6jJthkRnKHIk68 sDNI3/aS9/HUlpCGQHQN5Dk6aju7bEAtWpPshSgWkEx5MJcj4EHHo7rfGb3lLDdci+SN iUpgJ+nScBs2rSELesMaUBTDbC4TpKO2EcqaBDGQnF7mT+3+QvslVMWNB0qevowsCHYE cdqw== X-Gm-Message-State: AOAM531M6U8X75lK+MgBSYtfafF79fbXtEfSQ+Fb3guKAGQuJHxDaEiE adam8ff5qeDdKzY1i66IMr2xOkxHup5zJIRuI//gKRngA5LPEw== X-Google-Smtp-Source: ABdhPJzgZVtLY7sgGHGrY+BL71cCvFj0UdpZaKi+aT3SEnqm96eIvkE7j5v/zi7nd1x2UdWUNfOplu/1fAdlrgDL+QI= X-Received: by 2002:a9d:208a:: with SMTP id x10mr7072333ota.260.1608409828480; Sat, 19 Dec 2020 12:30:28 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Sat, 19 Dec 2020 12:30:17 -0800 Message-ID: Subject: Re: Limiting height of completion menu To: Vincent Bernat Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 26237 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On Sat, Dec 19, 2020 at 10:53 AM Vincent Bernat 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.