Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Possible bug: HASH_CMDS has no observable effect
- X-seq: zsh-workers 47377
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Possible bug: HASH_CMDS has no observable effect
- Date: Sun, 13 Sep 2020 11:31:38 +0200
- Archived-at: <https://zsh.org/workers/47377>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-09/CAN%3D4vMp4nkPQ9GrHNyDC4_qijrdfiuSmm-aE-AC_vOi1LjkvBA%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-il1-f170.google.com) smtp.remote-ip=209.85.166.170; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6G135OQcOPNJMk3xbGx+6yNq2CzHBqD8igcH96LRmmY=; b=jjNp8OXKtgkMIhJOZ8LFMX+AevOZy4yUfWdbtzvcM6o38MX3aexiUPwM/cWnKD4cHq Nqk0LZRsvcx3ZZ1N0+QpLEWlQYGR/yED5nO8h+uuuG57yOnh13oBxHW6Ih7NKnF3iQK9 Gv3+KVdZg2Aabyqkk/9A6vV4N5Gy59l+71kBpKVpQpdP49I9KAMok7KYMpzw9VB7k+hv onrBF8pi1RFsebeQ1p4z3n32Wfq8YIM3SJe++u1wPY7dRqtQSqlzDe5Grt5QtfNwPcZJ kp1tQ+yc2f22rRlc68SPmhXdmgkU1Js5RkMmwDPIkL0dVfTIYhZ6fmMDlTMeSk7G0pCo cr5w==
- In-reply-to: <CAH+w=7aBwDz_Uo4r2ohv9wLBpeHna2C9g0QGN5FsXmqs8Hh2CA@mail.gmail.com>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- References: <CAN=4vMqM-2Vu0n+QTbA9B_9z=3DKDdiOKbDRRaGGOG2rbY7-jA@mail.gmail.com> <20200911144852.GA1669764@fullerene.field.pennock-tech.net> <CAN=4vMrFhmKitKbdPdabZ1Ey9cjmEf62GVaGVMxn6T9AjZVc8Q@mail.gmail.com> <20200911161000.GA1679994@fullerene.field.pennock-tech.net> <CAN=4vMq-prFqopCW8apuYO8YUnuKL8G=WX+jBXFwgiFkfY=5Pw@mail.gmail.com> <CAH+w=7Y2VQpidVcinSXkQQqng0XjOwYtWL7a8jiYFx+te7fQCw@mail.gmail.com> <CAN=4vMrC2QjfxWaPUE9QS9tENBu=7BB=Hmp5rY6SaFahFThq=Q@mail.gmail.com> <CAH+w=7YDbOLz8Vp9v1tuweX9rGynS19GQ3FDiSryvqX=iz2sNA@mail.gmail.com> <CAN=4vMr0ucdLxfb+GMevBVT-=u1oNRr+Tc9EEVKizkeQC5tL7A@mail.gmail.com> <CAH+w=7aBwDz_Uo4r2ohv9wLBpeHna2C9g0QGN5FsXmqs8Hh2CA@mail.gmail.com>
- Sender: zsh-workers-request@xxxxxxx
On Sat, Sep 12, 2020 at 10:41 PM Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> That's exactly how it works. The search in execute() is only done if
> an absolute file location for the command isn't provided by the
> parent, which only occurs if HASH_CMDS is not set.
This is what I expected to happen but that's not what actually
happens. Sometimes, when HASH_CMDS is set, a successfully invoked
command does not get hashed.
Here's a new test case that doesn't use docker.
% zsh -f
% mkdir /tmp/foo
% path+=(/tmp/foo)
% print $+commands[bar]
0
% print 'echo hello' >/tmp/foo/bar
% chmod +x /tmp/foo/bar
% bar
hello
% print $+commands[bar]
0
The output of the last command should be "1", right? Everything else
looks as expected.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author