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 22814 invoked from network); 8 Dec 2021 17:08:24 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Dec 2021 17:08:24 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1638983304; b=Qkn2rxwpRTjOCT8arvIB1hvGmHB9N78qv86lkhUSovS9TsYegVM6XTsACjaTIXr1FYAKyFghAG yn2SCztsXxY0Y+qjggVmMU3aEeVaeAixBhrahvkwEftIDWA2xBgwqH/eBmKuN5TUf/RYAFqyds dNYeQ6ZyUcpWqz6BFoiDnyO6T9DgRlKWYXZVkFxOwvXkjH67JU9peA8zooBg7YC9mnZfv5UZ18 FVwNvltZr5PFf7vPavp3YYwQx41jo5gq5J6alPCKE+sCVb5NzOVolpxLl9qTOBQ0MSjbAkABQc Os2bvYp9Y43GVq5MmPNOyTT4t6qGnB6RhWAh3nwFMRGalA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f180.google.com) smtp.remote-ip=209.85.219.180; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 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-20210803; t=1638983304; bh=S+lNHNAlWcXAuo8J/VxemOB7GP1SRql8ZAlAfmmvh/0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=n/QL12NvTfTwt/WTTiHPelxFDKjAWU7TRa5epJQCgmSwacVRmx/x041kmyTyRl7NJVhTS7/j5V Gt5Kgiuxl6GadOZVd5bXhYkpUUiH5mwtpw7hWG0CZmomTls3s34mFr70D8omnU6iDbrvaxvufC v6XhRm9P2oNwbQasTmI9wlILTvyGS4gTlVElg3sKEJBLiUPdn48BzJ5867uv12QNWBmTzdxvY4 6LrEvK+GFY+m2V5uMxa/X7R2aRxUGvptAf39nwGEeZE5CFIqVKUYFNxuuu1i0gp6Jom6u70OMa Pbnk0/XjwRUdwoQo7bfjUP2PYk7WtDhd8iQQKj/t0qCvrA==; 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:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=J0S+1oRSqVN6KeEHxlNf9TcZtglkwog5D6DCTAcBG+A=; b=QlJUjuXHuYiwKmIYWH+/XMrkkA Hqb84MNO65/oKn1p5zbseCKLDCHb9bm62UJHse30s1PI4CXds7t7swh6J+4kSy40pO61jo7Tdj3El PQ5j/kzFtwRuzdct5tWJHZV0I2eI+8B8Ouhow7dzkCR8VNAalIbRpSDi0reqdPiIVjlzc/C1V1v/r WMnKBwTXuvBQuVkx1LNlF6YzMP5PIiAfp1lYVIrWpmiE17GXioRoimxh8cTxJlTOEagRyoUV5Et9v nz6szH5mR/gmbB5pdlzCHWUzB2ZCF1pLFL9F8XKI2vRf+p+J4Y97DSbU+fLXyk5OoLWo81i4bbPXs vf0UchFg==; Received: from authenticated user by zero.zsh.org with local id 1mv0QZ-0009N1-T7; Wed, 08 Dec 2021 17:08:23 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f180.google.com) smtp.remote-ip=209.85.219.180; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-yb1-f180.google.com ([209.85.219.180]:37450) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mv0Q1-00096J-KY; Wed, 08 Dec 2021 17:07:50 +0000 Received: by mail-yb1-f180.google.com with SMTP id e136so7508195ybc.4 for ; Wed, 08 Dec 2021 09:07:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=J0S+1oRSqVN6KeEHxlNf9TcZtglkwog5D6DCTAcBG+A=; b=vyo+HBnMe9QgTHI5OB1ZIcsZxr0Bbj2nnrYCtxCCGYxv5FCbnJ1PeBW9EJpzMhjVGR 82jLL2ZWTO/LDghWv0t+8EMy+3RMVN2Cr+RYSvafsjKMDySOi0JOStbungrNWHhzis4d D0dbCurU5ZS7DfqEBPsF4DI/2eyngBzECAXBosemavSqaomxIkT3DKMKBk25g1kTo/E1 OneADmPo+orikU/gq+CkUIOR9MUw1kQElKbE90cMxp2SX9/uUC0Hjffbgh84mSNvlH2T MgB7mHvkp0MAEU6NsFXgXb+aG+PzLjPoS4088xx1R2mZ8iR2lTFLHba/26/ITwq+kfKo E81w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=J0S+1oRSqVN6KeEHxlNf9TcZtglkwog5D6DCTAcBG+A=; b=o6oK+3Hj4V4RoZ4v3XVVIj6ccuzospT+vwaUMDdEDj46dYGBLKKxfcY7OR+CVAsYTz HoDLR6R2KdgxYsc3dmvpHOgP48k753VDyS1lCWMUhPHxjTo119aZZulQ5xxG0uAtv8lg sCmQXzm1m5fNlofrvWAK9FfYYRFl07AIKfqUM8X7qLcHsHGG8BuLqQurC2wiJrLcXlYp VZ+xFG9G0vs5tUsEX/oh2yKSc4wn1q5UnEDb3J5pTsqwd5Y3jBkJ13YiBgBoWtmWjkic PUo5IMTONBjySy0olSpGdvzqPuL0I9h8zDQDp6w+48HERSBKEJWhiKJcmsBRAtRGmhko jx7Q== X-Gm-Message-State: AOAM532BBJRnrCTDXfdTk3uZLorVNe6RpoCMT08Dbs+0rGZMWITHACLd cFnuRyqwJ04Diksn2vHm/9Svx2KT9xLMyktkjve2iQ== X-Google-Smtp-Source: ABdhPJwjrOtrCA7P9s1TKxj7fM0CLBqKd/gPwQxiV0i9qAXBIuSqRk+Xar/HsNXwm7dzL5IbB9aaZKy6XP9Npv4TDGI= X-Received: by 2002:a25:b682:: with SMTP id s2mr59274505ybj.736.1638983268362; Wed, 08 Dec 2021 09:07:48 -0800 (PST) MIME-Version: 1.0 References: <28458d4c-6b74-47eb-80a2-6b6e8c25a551@www.fastmail.com> In-Reply-To: <28458d4c-6b74-47eb-80a2-6b6e8c25a551@www.fastmail.com> From: Bart Schaefer Date: Wed, 8 Dec 2021 09:07:37 -0800 Message-ID: Subject: Re: [FEATURE][PATCH] Complete local executables with ./ prefix, if prefix-needed is false To: Daniel Shahaf Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 49641 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: On Wed, Dec 8, 2021 at 8:31 AM Daniel Shahaf wrote= : > > Furthermore, anyone who has already added =C2=ABzstyle ':=E2=80=A6:*' pre= fix-needed > false=C2=BB to their zshrc will silently get the new behaviour when they = upgrade. Yeah, that's probably the biggest objection to re-using this style name. > ...[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 "./"? The intent of the original patch appears to be to automatically offer local executables when no matching name is found in the non-local $path. Does your question imply that it should instead be possible to complete executables from arbitrary location(s) outside $path, rather than only locally? 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 and (I think) also allow one to e.g. add "/etc/" when completing commands after "sudo"? 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.)