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, FREEMAIL_FROM,MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15880 invoked from network); 28 Jun 2022 04:53:49 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Jun 2022 04:53:49 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1656392029; b=TJT8s/PBK99ZAKxuK6raR95BdU3ojio6jAPwKtSr8uKndHmzw98AE4WDl6iOTQN4DHgcoE5bCF fBz66v930NhdhnjV2hicbJLG6qFR6gq6kVMITJHrSglO70BFfQzIHSWzt257gkyRbFBfFaNBv7 gyZopN7+gYfpBa78bLlMfxKPlFeopp2n751jMlGHXXsA/4mQfYNLzvrapR+27lp0Na60Cc2MRx GORTEXVattn210JrE7zJupM+MRvBN0A2tLgKEKoIptUJ54Mpl256PhMIhuD57RxatkwBLDfMWR pnUHFy70tJRc6yPAPaAwx3IvDJ2gmKbOWrBNA9nIn3oiEQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mout.gmx.net) smtp.remote-ip=212.227.15.18; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.a=rsa-sha256; dmarc=none header.from=gmx.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1656392029; bh=888/O2nch//aCvQw/blzbuUCBPlk1D03aq35Ka3lkzw=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature: DKIM-Signature; b=pwLTPW2Mbq3DafuL0P4C44Lb9ULT4ywCISyfmmz+4FmiIzuMVIMiyaPc3+2Y1yS6SkoPb4foDa 9GHjB4+m0PGMm6npgc2R/ZFmDw7AC2gMQeRY84Au5JhBtZYJHpF+hwy4VO3E1GBkeHP+Vz5xGw 8fFDJlpFtVQZYVVmtGQlBYHFW9D06POwRUBpmEALmSO02A13Jpt620uKaNl5Zx8vRhNeVjT+gp e1z9Q9zu4DTlApa0ukskGVLJ2WFT3nu+fFaxoVLuI64iTXH0peKv9DT5Rtk0jyEsUGS6xOhVNm CDBwQ7ipSFfqHpnUy/rf/X9VKJGUCNrvVyexDCZYOvzx1Q==; 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:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=+4dLuzGWOK0osNFL/SJHhLJUCTjLsa6acf/8sa2mfjc=; b=LFXRAULXmn9xhBRbgbBLnDh0Ab f8HFW9Mv1W7juIWh6h5b+sD+9BA7MD6lt3DpThGnM137enacIMrH+rhyCEcxWKM89pqB23dfbHLA5 2HkyzMKs1DzHrEkOWXHXT2x0XbWs5SX/jor9yMFrRqCi7At2cmOlGyat615ZNUCESnfBEin4Hs7UZ 93ibyg7wnnMiMyd2uVvZT/2QGJrb+tFVlA09S5Zfui90FQq/XFCMjhkFIqIClxI9F7yF8aorfGi1y 31NSxKYnJ9kN5aJm7NiMditqyIxSu1Qxhlk/1sUZCM2QTXev/VpGEDMW+oy1bMuivhHDbUA960Z/H 2R5DFn2g==; Received: from authenticated user by zero.zsh.org with local id 1o63ER-000FvR-MT; Tue, 28 Jun 2022 04:53:47 +0000 Authentication-Results: zsh.org; iprev=pass (mout.gmx.net) smtp.remote-ip=212.227.15.18; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.a=rsa-sha256; dmarc=none header.from=gmx.com; arc=none Received: from mout.gmx.net ([212.227.15.18]:50627) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1o63Dq-000FKj-Ui; Tue, 28 Jun 2022 04:53:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656391989; bh=888/O2nch//aCvQw/blzbuUCBPlk1D03aq35Ka3lkzw=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=FPkvvocgJdVBV/aZUNaLQyl4ry1S/5lzaigT9qKA4F5QI635gON4WgLyDgxc3QZYE E/HGnQGz5QdtKsYC56dAyxJk+fnxvN+yYHXi1q6MGIF29pWfVgdo2U1ed60EeoaPvS DNxDhtEdgZiCTOvt5sLdZSmpjDwi7UfGiwV3nQao= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [10.0.0.14] ([71.227.85.179]) by mail.gmx.net (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MVN6j-1oFmfS29kl-00SKua for ; Tue, 28 Jun 2022 06:53:09 +0200 Message-ID: <3744fd9f-67c7-4aee-df57-d9c0f151d046@gmx.com> Date: Tue, 28 Jun 2022 00:53:08 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: Questions regarding _hosts completion extension Content-Language: en-US To: zsh-workers@zsh.org References: From: Eric Cook In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ikty3pa1gUxKdofFoialxUJ0oD7znX+CAMrXXGG1RbCoe5z0ium p3ifYjTnVw5P32+jYxzndCROrGV09FbNZ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DsnbYiEPY1ZU9QRUEG0jZNwJQ4KfHf8xasKWatUSoJyC3udXfv6TKc/D/OqXRdjQB i5nJd97nPFjEtFldkn5jNk4JL/uJ6Omj7Qs8DMUnXd25U8vXYQ9lOOUIxHJYowmfbG33jQi4W tp2q4CyZOnaPrPp7W7wyIs5QxMfq89/KTSr7J57q/ER80PzL4AQyiXDFbMdwj1E6ir/EbjbF1 9NQ3QUb3nkCRchndIt8ErgD6+zQ+BJ4qJ8Lx5P4r+svwj2QNfc9/+KukQ== X-Seq: 50394 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 6/27/22 17:37, Mikhail f. Shiryaev wrote: > Hello dear workers, > I have some questions regarding a stock _hosts completion function. > > The original function, IMHO, has a few flaws that kind of difficult to a= ddress without a heavy development, in particular: > > * It doesn't use cache features, so the shell instances don't share th= e state between them > * It fills up the _cache_hosts only once at the first completion, and = the only way to refresh it is `unset _cache_hosts`. A bit obscured Would be a useful improvement > * If one wants to extend the function with his values, then a way to g= o suggested on the Internet is defining a style `zstyle -e ':completion:*:= hosts' hosts 'reply=3D(...)`. Unfortunately, it completely overrides the o= riginal function. zstyle ':completion:*:hosts' fake foo bar # or use zstyle -e and do someth= ing dynamic. the fake-always style could also be used, see zshcompsys(1) a= bout them. even more fancy things can be accomplished when used with tag-order for a = command. like grouping hosts by domain name or other arbitrary ways. > * If `reply` executes any function or binary under the hood, the termi= nal hangs after each pressing. Assuming you are referring to the above zstyle -e example, it waits for th= e command to finish, it should only "hang" if the command being executed does so. executing something that is = slow is probably not a smart idea in general if you are expecting fast results.