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 4387 invoked from network); 8 Dec 2021 19:14:16 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Dec 2021 19:14:16 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1638990856; b=itbbKvqs4YoGRfrtuPuD1TGLitnaq+fj2F2xy0qzu4PFk+8m7+MzSykmHf0BdfevywmIl52t04 cvLOFSPO+gREz+FQ+BdQw3ek+pGptY4TKKL+Vf9hm4lGkME9Yq3/Jr3M6WK62J35fq77x1NuSv TBP5WoY9uvIUEqtl3f6IpPf1oHuSYn9rbC+m+4sRugxe3Q99PqnGIJHSqs25J47/E4eHf4/euK 0R1MF2syCXwMgxInvPRt3/EkYi/vnIVq8zi8j3DlFcN/qcPedbbQZovq5A6BjAoAYQMvOxtvZ4 ZGauSn4Xrddw7o3ocdV4hnpu2ABqPC7UzuudNnVhrXlqCw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (wout1-smtp.messagingengine.com) smtp.remote-ip=64.147.123.24; dkim=pass header.d=daniel.shahaf.name header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 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-20210803; t=1638990856; bh=UGpSRifsgk69XrMF4VeJeelWoAx4bSc2fHZ4rgvCjeo=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Subject:To:From:Date: References:In-Reply-To:Message-ID:MIME-Version:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=GA+8JZkBzao0AoVU9ZIqaX7kRm7xD8ayAodP92q+LmcxHJ9YyXIY370Q2F4C5n9xv8C0EeMYvw hcLInPfAQ6q7cWEJQEujAwv6ou3kRKSg+LPe3Zbwx0qD+zqpDx/Ub2KCp9BMuQ91hbCCauwIpY Fo+26y7OIU7L2IqEYYVJlF+y/YtMCxAcqhsD4UlzT7+Fqd47qcucP7wSsIP3RJYkcg45ViWNei o9wJZuBCUKahq7Nw/8qxsvaRcJHi+ArpcwAlg4jrNB5x2S63rvF9WjH5++P/s0c+eC+R5hasRp o0ZHlAPRuxlzozy79Cf9cDspUzryIVzY4Ua72rlgjAsXwQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Subject:To:From:Date:References:In-Reply-To:Message-Id: Mime-Version:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=dMXbOEBTy1npYtV81xxoZFjkeS+VrZULglChSJA2t7A=; b=N2W9TGDb1ECmVi1O/4OHW5mBIA rikfUUoBrj9Wkm1mE19XdQ4CePdZtLQqJUZ7H1XeYixuyO/Wknzb9e2gP1GhWY5lU36oDvoDcEZak MQn7ukHfKJYjM7rnHsXldYy8Yu96wUqrLIQ+w9bc+acki+fNKV7BUXrHWLBaT0v+7A3+cjBX/ze8P JtCq6o2RC84cFRVc7guCcZeUb6CJmhJhTJPAR7SLD8LiGD9qvJxPR/6hjfUnVEZuwhQGg/PZsIffw K4ZjpJi+33814XycpSZtT7kqF8BgG+kHmHfarADJZfa/I9vojjWerViLeK+dUTd4964sso2lMF+y/ pRM+Hvew==; Received: from authenticated user by zero.zsh.org with local id 1mv2ON-000Cvs-CF; Wed, 08 Dec 2021 19:14:15 +0000 Authentication-Results: zsh.org; iprev=pass (wout1-smtp.messagingengine.com) smtp.remote-ip=64.147.123.24; dkim=pass header.d=daniel.shahaf.name header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:43479) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mv2Np-000Cdn-Ck; Wed, 08 Dec 2021 19:13:43 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 074103200A64 for ; Wed, 8 Dec 2021 14:13:38 -0500 (EST) Received: from imap46 ([10.202.2.96]) by compute5.internal (MEProxy); Wed, 08 Dec 2021 14:13:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=mime-version:message-id:in-reply-to :references:date:from:to:subject:content-type :content-transfer-encoding; s=fm2; bh=dMXbOEBTy1npYtV81xxoZFjkeS +VrZULglChSJA2t7A=; b=gtqANNBDE3gQCPFh/YgPh7xAiw/+wgs9kjyM7g4FZ9 PxYEQl0HvehPuSY7zQJF8LtAANO8yTZulgDI7H7ifiV9Q6UYiroE8DGcySLNkP6K yxOYnwUHLM7AsGN8yzFA4vub7OBc2tBEfZNMTUnd4WgTd/0hWNgPOEXYPIAGzGFW TCn3N/svgd6DpGLtJPRttfauQU5i14ylnBXG4NN4+DZssmVkciHcj5yr7HaRfLp1 FvCtuqN+NZkB42kXKiaU7GenOzv1H3PiG/mh4kx21O6jqpfc3TbFYxHKuVGwRT5o py0ce6FyYOG81kugbVmnoXhSyxPUy65clRMq4+RxlkcA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=dMXbOEBTy1npYtV81xxoZFjkeS+VrZULglChSJA2t 7A=; b=kMmHSMsDLqnSAE58Kp/s7F+yoFoXcktfDfSOGPqO5L0dVtgEYsCqaMUL6 U49BqTlOHfbktwMI4yz0+DZREIotiTIvOpVKJ1nvjw9Q7mM4Y3cI/eRhzsuqSg8C hTQLIruWfFozS9qQfQpDws2IV2KtkMyp/wD0jXtjjcZima2/Ni/kTK0ZVr3OofKu Z5wzX2LP8fDYe0mtLY3cF8HvJNhIhNojnAfHIIIVBxXWSjcD6w/mnTxP14GXhgxq HgRkn2IjLovM8ljbUfxH7DckLObWyb4AHtJ3bg+2bhKFHK4iVZZq+ZXvfA/P6RBR uvnXTmzJjVT6t4uI42MOFG4kbbO/w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrjeekgdduvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtgfesth hqredtreerjeenucfhrhhomhepfdffrghnihgvlhcuufhhrghhrghffdcuoegurdhssegu rghnihgvlhdrshhhrghhrghfrdhnrghmvgeqnecuggftrfgrthhtvghrnhepfefhkeefve eileelheeiffdtkedujeelvdfhtdejtdeggedvuefffeelhefhvdfgnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugdrshesuggrnhhivghlrd hshhgrhhgrfhdrnhgrmhgv X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id E0A381EE007B; Wed, 8 Dec 2021 14:13:37 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-4492-g121c2470aa-fm-20211206.001-g121c2470 Mime-Version: 1.0 Message-Id: <9df0a670-078b-449d-9439-127853f188a3@www.fastmail.com> In-Reply-To: References: <28458d4c-6b74-47eb-80a2-6b6e8c25a551@www.fastmail.com> Date: Wed, 08 Dec 2021 19:13:16 +0000 From: "Daniel Shahaf" To: zsh-workers@zsh.org Subject: Re: [FEATURE][PATCH] Complete local executables with ./ prefix, if prefix-needed is false Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Seq: 49642 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: Bart Schaefer wrote on Wed, 08 Dec 2021 17:07 +00:00: > On Wed, Dec 8, 2021 at 8:31 AM Daniel Shahaf = wrote: >> ...[Perhaps] a better approach here would be to complete >> both executables in $PATH and executables in $PWD, but under separate >> tags. If we did that, prefix-needed would have its usual semantics in >> this case. >> >> Second, if Alice's $PATH does not include "." and her zstyle settings >> are such that =C2=ABzstyle -T :=E2=80=A6:executables prefix-needed=C2= =BB is false, why >> should the implied prefix be "./"? > > [=E2=80=A6] Does your question imply that it should instead be possibl= e to > complete executables from arbitrary location(s) outside $path, rather > than only locally? I was not trying to imply that we should complete executables from arbitrary locations, but to ask whether we should do that. What use-cases are there for wanting a prefix other than "./" to be implied? (not as the default behaviour, but as an opt-innable behaviour) Brainstorming: ./bin/ # Could be useful at the root of a project tree whose local scripts # (such as our Util/preconfig) are under an FHS-esque ./bin/ # directory. .// # to complete in subdirectories of $PWD. E.g., =C2=ABmk=C2=BB = would # offer =C2=ABUtil/mkdisttree.sh=C2=BB in zsh.git and =C2=ABsrc/mkhe= lp.pl=C2=BB in # curl.git, as =C2=AB.//mk=C2=BB does. # # Today, to complete either of those, one would type =C2=ABs/mk= =C2=BB or # =C2=ABU/mk=C2=BB. Supporting this would save typing "s/" or = "U/", just # like the OP saves typing "./". ../ # to complete in $PWD's parent. E.g., when one has version control # worktrees of several branches of a single repository in sibling # directories (e.g., ~/src/zsh/{master,5.8,5.7}/), the common parent # directory is an obvious place for scripts that might need to run # in any branch's worktree. "$(git rev-parse --show-toplevel)/../" # Ditto, but from anywhere in the worktree. /absolute/path/to/the/src/tree/ # when $PWD is the build tree of an out-of-tree build. Useful for # running =C2=ABconfigure=C2=BB a second time, or for running just o= ne piece # of a test suite (calling the scripts directly rather than via # =C2=ABmake test=C2=BB). /sbin/ # This would allow completing =C2=ABifcon=C2=BB to =C2=AB/sbin/= ifconfig=C2=BB # without affecting child processes, and would cause such command # names to always appear in history as absolute paths. Alternatives # including adding /sbin to $PATH or =C2=ABcommand-path=C2=BB. I also considered a prefix of =C2=AB=3D=C2=BB and semantics involving th= e EQUALS option, but haven't come up with anything. > If so, then instead of (or as well as?) prefix-needed, an array-valued > style 'executable-prefixes' (or whatever) could provide a list of > places that should be searched and automatically inserted ahead of the > command word. If combined with the patch's prefix-needed semantic, > one would need to both set prefix-needed to false and set > executable-prefixes to include "./" in order to get Marlon's effect. > That would solve the "silently get new behavior" issue *nod* > and (I think) also allow one to e.g. add "/etc/" when completing > commands after "sudo"? I guess that would involve inspecting ${+funcstack[(r)_sudo]} or ${_comp_priv_prefix}. > One might then also be able to use the existing mechanisms to create > additional tag names, rather than wiring a new tag name into > _command_names. (This is vaguely similar to Zach's question about > adding a custom tag to "cd" completion.) Thanks, Bart. Daniel