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=-1.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27698 invoked from network); 11 Sep 2020 14:49:18 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Sep 2020 14:49:18 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1599835758; b=JIDW8PYOK0XPyG7Yd+pz3OdthIv+FQgsb2Jqss/wdwgDt7qBU/T+FKxZF/Fo5nf71r2WgyztO6 UiqWyOV3vlLqbJ/EVRhUSCUmOdt/ylJvNH34cn8CXyyNq8KGvCqgN7qkQVVuwqO18D4ckVl47f MGzfUIKG0rSyUFIx9Op9jJEx0qxHfHT18IxUsNtdbQRaSwiTq/N/f4QeziwzaNIZ2sFfdMd7ii fB9x4WX1N+1cp/Gsgmp76YFBf/DKLchjmuGenyHePkinfeM1F5yJPaI6QrFiAYS6DA7ohkw8UF aQfa9XK7R93hBIPUGaHcYnQovoIlt9AzLRZxvycGaZ5/ag==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mx.spodhuis.org) smtp.remote-ip=94.142.241.89; dkim=pass header.d=spodhuis.org header.s=d202008e2 header.a=ed25519-sha256; dkim=pass header.d=spodhuis.org header.s=d202008 header.a=rsa-sha256; dmarc=pass header.from=spodhuis.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1599835758; bh=bolEKJCslkbcvsB/hk3FY7SAmG14zzQR15xY3mpZHkE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:DKIM-Signature:DKIM-Signature:DKIM-Signature; b=KfXgTSMVruYsD4fqutKTXp7ylqErWj987GXIX8pXX+P+HvHVNtbBPIreIMRH6Xam+m8AxLXP08 20wV976SgsV8f5yrCRG1J3y0sJ7Pw1qx4CBgFoBZuIEg2dGOFfpjIqnbbl5BKYPD+34iEpCwGb tC/Hsn2DqMGKwI44z5pe5CxCmsdCEgsciAwmrUWMBFN4Rt81JVtYz0jhIAZkY8w/aMRG54RpuG 943n2t5SExQwAT6uxDkLd/toOQdrjSYM3HntGjdDSuOoKBgmWmgpsX+w76jWvXsNcpQ5x6Hbe0 Q2O38kwxMDOelY/65gzqJnn/rYBwxwnskcg78t1rkeZQSQ==; 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-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=MEulw0ut3zVU2RYZAmneFk8pgVj6qELyqYqyMH2YDJU=; b=c39nSxvEfiHxTCrzCAb9DF8k9L J2tlbFSbdoGFxI55xA9jqoH2qaXKCWuDAs9dYq4NBTbZqK2uACiyMd6mVj81Da/SinO8dEHrVQ2LR kRWm2Kb1Z8oavi94qoP1V5gliy4+YF4/BejGJLWXqothHmPR8gE3neoXujcXRlreNPPcfMUCekvBh V2rnuwoD7AkHmrXnVuE1IU1HteAzRPy9mNoOZDjt5L78q44bWjEwHYSpKBuIhdZiI9v0AqNeNZIGC GI091WP6i/lfXdbhE5zuysXjmByvLv+Nqbx/z3gVxx75YEnw+/wZLv73jF1Eqn4KNfqgt/sVh25tU kuIEfKBA==; Received: from authenticated user by zero.zsh.org with local id 1kGkMV-000GG1-AU; Fri, 11 Sep 2020 14:49:15 +0000 Authentication-Results: zsh.org; iprev=pass (mx.spodhuis.org) smtp.remote-ip=94.142.241.89; dkim=pass header.d=spodhuis.org header.s=d202008e2 header.a=ed25519-sha256; dkim=pass header.d=spodhuis.org header.s=d202008 header.a=rsa-sha256; dmarc=pass header.from=spodhuis.org; arc=none Received: from mx.spodhuis.org ([94.142.241.89]:29901) (DNSSEC AD) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1kGkMF-000G7M-JM; Fri, 11 Sep 2020 14:48:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d202008; h=OpenPGP:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Reply-To:Subject:Date:To: Cc:Content-Transfer-Encoding:Content-ID:Content-Description:OpenPGP: Organization; bh=MEulw0ut3zVU2RYZAmneFk8pgVj6qELyqYqyMH2YDJU=; t=1599835739; x=1601045339; b=NHuOoTsrQ5JJt7W+hySzO2UTa4mQ3BZ1NsE2yti3Z0bwbdCIOE6HKgk5FbzO 7YkJb84OSnPh3M6YYVce9Uua4UJ98hDrG0NaYc5iN4YH6e4gCsU3sARrZyYoGUlvaYz7h838WdI6J +MzB4JNLnSQEV0BbIFXFRNyunanqgjhYRs+9h7wykF5UTssnrnBFB+R/KabCFRZvw1pj+TIPtm67F ciV/BHe3LFE84MrVfgIBagitZfJXH/AGU4vVOEQ0dstrW3k8VYDpRDUVIDAX+cfkWbXeQdGRCcUpi u/sva7OezAo2ds6fQktK0gv0NvScCKJDfASIBSq4qBdWMYrhADA==; DKIM-Signature: v=1; a=ed25519-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d202008e2; h=OpenPGP:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Reply-To:Subject:Date:To: Cc:Content-Transfer-Encoding:Content-ID:Content-Description:OpenPGP: Organization; bh=MEulw0ut3zVU2RYZAmneFk8pgVj6qELyqYqyMH2YDJU=; t=1599835739; x=1601045339; b=HyS5zcF1h+fJ+8dy1ZwEQ3a78A01qci9jw+UHNkcatlFXwFQ/sb56r1xokin rAzKxyaYFb9DVO98vC1OFyj3Cg==; Received: from authenticated user by smtp.spodhuis.org with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) id 1kGkMD-000G7B-Dx; Fri, 11 Sep 2020 14:48:57 +0000 Date: Fri, 11 Sep 2020 10:48:52 -0400 From: Phil Pennock To: Roman Perepelitsa Cc: Zsh hackers list Subject: Re: Possible bug: HASH_CMDS has no observable effect Message-ID: <20200911144852.GA1669764@fullerene.field.pennock-tech.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: OpenPGP: url=https://www.security.spodhuis.org/PGP/keys/keys-2013rsa-2020cv25519.asc X-Seq: 47367 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: Archived-At: On 2020-09-11 at 10:21 +0200, Roman Perepelitsa wrote: > From the documentation for HASH_CMDS option: > > Note the location of each command the first time it is executed. > Subsequent invocations of the same command will use the saved > location, avoiding a path search. If this option is unset, no path > hashing is done at all. However, when CORRECT is set, commands > whose names do not appear in the functions or aliases hash tables > are hashed in order to avoid reporting them as spelling errors. So, if and only if CORRECT is set, then non-present commands will be remembered as not present. > % sudo docker run -e TERM -it --rm zshusers/zsh:5.8 > # print $options[hash_cmds] > on % docker run -e TERM -it --rm zshusers/zsh:5.8 7190647e021a# print $options[hash_cmds] $options[correct] on off 7190647e021a# setopt correct 7190647e021a# print $options[hash_cmds] $options[correct] on on 7190647e021a# rsync zsh: correct 'rsync' to 'sync' [nyae]? n zsh: command not found: rsync 7190647e021a# apt-get update && apt-get install -y rsync [...] 7190647e021a# rsync zsh: correct 'rsync' to 'sync' [nyae]? At that point, if you type 'n', then zsh will go ahead and try to run rsync, and it will succeed. You will need to run `rehash` (or whatever) before zsh will remember, for correction purposes, that the command does exist after all. -Phil