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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12641 invoked from network); 24 Jun 2021 19:33:42 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 24 Jun 2021 19:33:42 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1624563222; b=Kqn7U3gA3p64mBoy230ESkGEwimWrGvQpoMEgeL0GJXJnnFEQB9AtFqPr0qeE0L/GaLl2LawVH 9gEFVY+qfNiI/Lpa00vygLHZ9ev823U8WSgggcaamxjKBYYLACD5wMqM6J3x5UsSU6i9jwIZ4d rXvEgzUMYeAjSfWJUIFfYMEBzVlB2ybcbIh/vYotHbPaEvQMG9t6+WOGyV13IZUO5qpkbzo4Zm ky8ZlI1K8Ufa8Yuu3oX1p7etiaqtv3UXOtYpBBXILICCGcj8Npkk81zI9FNwNV/Q/5yR/hBGru hgf6CQc+YiaroDf7H/YFE6wFHaSa3Exr5Q/ZuPbD6ziwbA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (wout4-smtp.messagingengine.com) smtp.remote-ip=64.147.123.20; dkim=pass header.d=daniel.shahaf.name header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1624563222; bh=kSdvVpAbpt3mMT2Z78ysgGYVK72/dPl56IN2vtnX9DM=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=FkOpT1V6ZcV87Gh37u7lW8AN7FWEs+dDY9KjsmLucNU0oUHg1tBYJH9NDGafcYq/x5Iirdi7/K KXhGl0pTpq9IYDFph+cijzH8QplykiuBXOgEWzLeCQkR4H+FwU4+EwyTQJIHs9bUK4AzkMrIG8 qgxYDazM6fhKH00QdN26C1SxfUgzmHTnpDS6d1/sUvmD/8Ycx9yfsRnxLzPZqiWYFLH2WZ7/WL UcSpfiLGEn38vMT8RH02b5/EidZo88Vl+XOqzBs3Qbf4aSV1yssxkXlhlEgPBNMrbxoa1TioVy wJTpiMvAYQigL2Jqqxdd8kH8Fsyomg6un01rEvKZXKLASA==; 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:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=7C+qY819nVtChaHXZV82/unpfNsnsiyse1iEPSDEqBY=; b=rq4j7HS8mEoAJBV0w+Yr+3CJja ZBEwi23wx7nbiKBQpNRVCcRAB3Jpz8qUcg8uvPhuzF53fnDrBbASGfkyDKYqpW/8ZxMwauS/oPReZ uNKXVe0I5egXRTJgir8wuKZDozqKOcpDX6Ts84vaJrTcH1LJjRQSLOzt8MvkIStgZjQZbhPdKw4tz qm73Yy7b6m6FB88OCS0j1kHXtuSWRLxCyAy1mfWaDaiIzlBLiZvUjb4iWQ2COBNYEORFBnsfKcElb OXGTfCCoiDhaHyOJU7LMtbV5Auk14gFOpzwTLjBV4K0b7spHHAY9ybkFJPk2jtqOClZkKT58xdQOA pcpeT6gQ==; Received: from authenticated user by zero.zsh.org with local id 1lwV6b-0004od-D0; Thu, 24 Jun 2021 19:33:41 +0000 Authentication-Results: zsh.org; iprev=pass (wout4-smtp.messagingengine.com) smtp.remote-ip=64.147.123.20; dkim=pass header.d=daniel.shahaf.name header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:54245) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lwV62-0004Vj-5e; Thu, 24 Jun 2021 19:33:07 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id D624A320090C; Thu, 24 Jun 2021 15:33:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 24 Jun 2021 15:33:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:content-transfer-encoding :in-reply-to; s=fm3; bh=7C+qY819nVtChaHXZV82/unpfNsnsiyse1iEPSDE qBY=; b=FjDFnTs1330GhU3CqoR0xPwjjIxzH78ZnMB04+2oC1nqJI0BZ0Fr27wY lZ/m5swPpJfpocw+tNMbccB12NzgQBRpK8czWUBxKMe5ImHlH1f4omEJu2jrd1nj ZdhRgduqcr5913pTsYOKa3KcPeyjqAoH1pkZw2eT3c2OELeeDEbDSJnNU9/ReTqq mJzBtfk9BMu2ajF4Ws7kurmmYB1RqB/2iKBU85Jv7Mbw74ykoxemdRcqEcm9i21z 25B/tYc89Kk7FZG3+aJsU6S+rHIXAwR/ikOd7NN5idf7v29WOyTWIS6yIG+HkVgi UMRMPZ0ZPuF8mS3M1/wWt1xDbznEfQ== 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=fm3; bh=7C+qY819nVtChaHXZV82/unpfNsnsiyse1iEPSDEq BY=; b=BrfG4wTr3Mkab4WBe9kHB6nDrhEmu26HbzKxkgPXJHP6W/2lmjQIoBbkz ZHq7cdMPWdreLGQ1j0bmYDBwTUXIOuKDGPxOhyEDLDZybjdOWTYuTeSWXb7d8GL0 r2Q8F+avdwHmbo0MnGcpESEVnIT9e4PXw1ZlM7nPEuTgbBpdAufLN88PNyhhRBNo 0+nqg4e5+K+GKoyAUYcz3S+5ht3KtfCWtw+XEayI5eP94cehkUumvVNMLtkSyX9y y5S3n5qv89FguUsa5r40tbBPbP75IFFxs4uxFuHNB8CHNaMaMWt91inSyg/j+Skf kEarDldXjJlZcCEAad85Ahy84E9Cg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeeghedgudefkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtugfgjggfse htkedttddtreejnecuhfhrohhmpeffrghnihgvlhcuufhhrghhrghfuceougdrshesuggr nhhivghlrdhshhgrhhgrfhdrnhgrmhgvqeenucggtffrrghtthgvrhhnpeeujeeugfduie eljefgheelfedvveehheeludfffeduteduheegfedvhfeiiefhveenucffohhmrghinhep iihshhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 24 Jun 2021 15:33:03 -0400 (EDT) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1005) id 4G9qzd09lvz4fb; Thu, 24 Jun 2021 19:33:00 +0000 (UTC) Date: Thu, 24 Jun 2021 19:33:00 +0000 From: Daniel Shahaf To: Timo Cc: zsh-workers@zsh.org Subject: Re: Menu selection by number Message-ID: <20210624193300.GD16386@tarpaulin.shahaf.local2> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Seq: 49117 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Timo wrote on Thu, Jun 24, 2021 at 20:57:57 +0200: > Hello there, > > I'd like to pose the following suggestion: > > Display menu options prepended with a selection number which can be used by user to select option by typing the number. > Motivation: I am using voice programming and numbers are a great visual aid in quickly selecting options. Anyone who wants to type even less could make good use of it. > > It could behave this way: > The autocompletion menu lists some options > The options should be prepended by a uniquely identifiable number each (for the current menu display) > If the user types further and the menu changes, the options' numbers are reassigned to the newly displayed options. > Numbers should be displayed in a sorted manner. > > > Example: > > > ls > test_file1 testfile1  testfile_1 testfile_2 testfile_3 testfile_4 testfile_5 > > # Press tab opens auto completion menu > # without numbers > > ls test > test_file1  testfile1   testfile_1  testfile_2  testfile_3  testfile_4  testfile_5 > > # with numbers > > ls test > 1: test_file1  2: testfile1   3: testfile_1  4: testfile_2  5: testfile_3  6: testfile_4  7: testfile_5 > # typing 3 (or for example ALT+3) would complete with `testfile_1`. > > > What's your opinion on this? I wonder if we should just make choosing a completion pluggable: have compsys call some user-defined function with the possible completions as arguments and let the function report to us which one was selected. Then, implementing a «select»-like numbered list, or "search completions by description", or for that matter a GUI selection dialog with bells and whistles for cases that offer completions from multiple tags (e.g., «ssh », «git checkout », with «tag-order ''» set), could then be done in third-party plugins. («select» is a shell builtin.) Also related: - list-colors can be used to hide the common, already-typed part of completions, and colorize the first differing letter: https://www.zsh.org/workers/38518 - The _match completer lets one choose a completion by globbing to it. (E.g., «ssh *lsh» → «ssh danielsh@») Cheers, Daniel (Aside: Would a non-looping variant of «select» be a good idea?)