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.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5839 invoked from network); 24 Dec 2022 14:45:15 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 24 Dec 2022 14:45:15 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1671893116; b=WlO/CTQ6gPOnGbh2BAczxJg5neapoX44WmyCo5KjMZT8uVLzwcwTV5jOwZdQ/eAqzpWLjDI9UI aIX6jsmcBJMTxntuLrsgvvEmnI5MJiv2yncchvs/Ml0mEI1Ocock0UiZ3Da2zH4MtO9wMY16z0 fdNmD/xnOoW82V0p/mDNXk726TuV7L0AwZxF+lPgX5Nq0i/JP8avVclb4QaYjo+zxPuxblO60V nIi6j4XB1fcoFDHpkPpWB09cWs6jH3mh30+jp0dU1d/0fU/2HqjhMIoOKbnYw3f+mUNpmPKvJ6 eSvOohln4y4QXmv7HneFTTCe+rGMbXnaURsl7lm4d5HiZw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f178.google.com) smtp.remote-ip=209.85.219.178; dkim=pass header.d=ridge.co header.s=google header.a=rsa-sha256; dmarc=none header.from=ridge.co; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1671893116; bh=yGOH07q/ctwimKmFxQMqooriByMJVQXiy1LbaHSP5EE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=cR0K0QteKQxlkwriYX3oaM6qfF4JelC9qFdZznWUW2Cm1ekBLtpfmZM2qH5ECQRdFtU8pBSQfX a8JFNB8HkYv2StVqEAmi9nQpQBBAjfEJw9CeQhgWKNo1/XusuJWsFSTWyvD8jO6Rj5BXfw7zez v5CsQ5naZGR9adggitDs/bCuDvTT2UO8VbE2IprUEhnE9bMl9d81OazIniTgHcoet0kR/tMV3l Czcio74sgZyCGmgbjRVAK2418mEiuZpGc30dO6Q04zRXhuIn7Oi70nxYP1dw60jINPPBzpR6Cj voGXDxIgefddlH/+dhCrtClmGYGTRpslt3lixkkd3LFhfg==; 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-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=zfJs9gBs0RCv0Mdw5gu2G6bME9lbnln64LoBuhEiaaE=; b=pKR0B39QoZP5RXR6tPo5s8BelS m6SiBr234mibo2qTbve04kvCjNZE3jW+3kgLnTqmH+ioWm09hAggjN7dlYyW7LFarjbIDlOd2SPxg awcS5C8xOngaEfURdDIs0KeH5rBdEir24pq5DSN8zVr3K7sKtxFvlju1xdDDEWbi4qMGPxG+4F7J9 NU8jSWq95EtZHRUpdI8JXG0MDwb65tgljCXbNtMfKFWIWhTxw/7s1ZW1R7UlWd2zsSf5C5QQhSrt/ popUPVJFWQjMx1oXYy55bqwgjiGPYw0Q5+qcMXEBdzlbBCK7Z5VhlPRPS/e+TYzzi19sevtyfJ8VD CJ5bR8YQ==; Received: by zero.zsh.org with local id 1p95ly-000LcL-42; Sat, 24 Dec 2022 14:45:14 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f178.google.com) smtp.remote-ip=209.85.219.178; dkim=pass header.d=ridge.co header.s=google header.a=rsa-sha256; dmarc=none header.from=ridge.co; arc=none Received: from mail-yb1-f178.google.com ([209.85.219.178]:33374) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1p95lR-000LIx-FH; Sat, 24 Dec 2022 14:44:42 +0000 Received: by mail-yb1-f178.google.com with SMTP id b16so7986784yba.0 for ; Sat, 24 Dec 2022 06:44:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ridge.co; s=google; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=zfJs9gBs0RCv0Mdw5gu2G6bME9lbnln64LoBuhEiaaE=; b=ZAsp3CJB9ynqSMF8OV8vt6b3//RLy12s/Ee0JnUmmiu4Gb+6EBs0MRAYjQTx2efg39 Yk/RIbDSKHbvR2aXoJ1675XiKcwxot/mdjp/ouTCu3PLY1XbPfw6vpELdR3fgAvtSV/7 8FdhOdSG6F+8QIbJ05OEAnnmL4siyMnuYsyrX6LFp/eVyYXn8ZOro3alXx8RSjzaTjZT uC6VV8+hZmqms5gbCWlOOFHR++Y//dH1LyCJ11q48mvFqoIQo2YRF1krLRNXtP1T3vKE jgChdFPf2xc8Hut0/b7Gdq03YhYf2vsBP1LrUadNNT83kRbxBlOROkZ4QUuPEK9t88Xs +uQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zfJs9gBs0RCv0Mdw5gu2G6bME9lbnln64LoBuhEiaaE=; b=S5D7yDEW9+TddLClrclZTMNdN1lyJZlTWB5qt71em/AUrW48G+G8GPSY525UHdfwCD SXQXo55hAK40TYNknDsIXV5fbhzdSyEwyt1PaQDXRUcp/AD+eh4UM27qlbcvrUfonVXL m3TJkHZGcNGl8O3VeqaCtAi4Bg3aUY/hlgKwLpppwLN3As+UBntCVAWcEXGWNzo2ad0U 2ivW/MPm2jZ1c0IHZhYZ2qmYFiytSeY3gEvhelnSLkpF6dj9TiF2Y7O9qtcKcLVngUjF EfBZqmaXxhR9EdLJnBz7KDEP4HKces5tGw0pLi/QM3g4J6xWWh6xfUddL1iairJCHq02 +xng== X-Gm-Message-State: AFqh2kq4jCaBmdkf+2OFq8Abcg/s7vfFsoTMSsPx2YfyWKxB/ivyizEV /gZXX6H0NUi9m0H+1gQvHKXXU9irVQHmQxNvptbFZDNRu06IJSYl X-Google-Smtp-Source: AMrXdXs1RybomKcuIuHjEqr4okhCIw3+1UEH4+C1ZsU9Geo/IYXFF5zYF9sG06A+WVDhXY0tBkolImjPdcH+63S+qHE= X-Received: by 2002:a25:d74d:0:b0:739:a1c7:f11a with SMTP id o74-20020a25d74d000000b00739a1c7f11amr1189143ybg.461.1671893079210; Sat, 24 Dec 2022 06:44:39 -0800 (PST) MIME-Version: 1.0 References: <20221224111716.GI8411@tarpaulin.shahaf.local2> In-Reply-To: <20221224111716.GI8411@tarpaulin.shahaf.local2> From: Mikhail Gusarov Date: Sat, 24 Dec 2022 15:44:03 +0100 Message-ID: Subject: Re: tar completion fails on tar files with colon in names To: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary="00000000000016d15705f093f103" X-Seq: 51250 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: --00000000000016d15705f093f103 Content-Type: text/plain; charset="UTF-8" Dear Daniel, This change works for me. Best, Misha. On Sat, 24 Dec 2022 at 12:17, Daniel Shahaf wrote: > Mikhail Gusarov wrote on Fri, Dec 23, 2022 at 13:17:26 +0100: > > However zsh completion for tar does not take it into account: > > > > % zsh -f > > % autoload -U compinit > > % compinit > > % tar --force-local -tf x:foo tar: Cannot connect to x: resolve > failed > > The reproduction recipe requires ./x:foo to exist and be a valid tar > archive. > > Can you try this? > > diff --git a/Completion/Unix/Command/_tar b/Completion/Unix/Command/_tar > index f9901c0c9..1cabd9713 100644 > --- a/Completion/Unix/Command/_tar > +++ b/Completion/Unix/Command/_tar > @@ -158,7 +158,7 @@ elif [[ ( "$_tar_cmd" = *[xt]* || -n $del ) && -n > "$tf" ]]; then > fi > > if [[ $tf != $_tar_cache_name && -f $tf ]]; then > - _tar_cache_list=("${(@f)$($words[1] $largs $tf)}") > + _tar_cache_list=("${(@f)$($words[1] ${words[(r)--force-local]} $largs > $tf)}") > _tar_cache_name=$tf > fi > > > It doesn't account for possible quoting on the command line. > > If it's right, might I ask for someone to commit/push this, please? > Trying not to stretch myself too thin. Thanks. > > Cheers, > > Daniel > --00000000000016d15705f093f103 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear Daniel,

This change wor= ks for me.

Best,
Misha.

On = Sat, 24 Dec 2022 at 12:17, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
Mikhail Gusarov wrote on Fri, Dec 23, 202= 2 at 13:17:26 +0100:
> However zsh completion for tar does not take it into account:
>
> % zsh -f
> % autoload -U compinit
> % compinit
> % tar --force-local -tf x:foo <TAB>tar: Cannot connect to x: res= olve failed

The reproduction recipe requires ./x:foo to exist and be a valid tar
archive.

Can you try this?

diff --git a/Completion/Unix/Command/_tar b/Completion/Unix/Command/_tar index f9901c0c9..1cabd9713 100644
--- a/Completion/Unix/Command/_tar
+++ b/Completion/Unix/Command/_tar
@@ -158,7 +158,7 @@ elif [[ ( "$_tar_cmd" =3D *[xt]* || -n $del )= && -n "$tf" ]]; then
=C2=A0 =C2=A0fi

=C2=A0 =C2=A0if [[ $tf !=3D $_tar_cache_name && -f $tf ]]; then
-=C2=A0 =C2=A0 _tar_cache_list=3D("${(@f)$($words[1] $largs $tf)}"= ;)
+=C2=A0 =C2=A0 _tar_cache_list=3D("${(@f)$($words[1] ${words[(r)--forc= e-local]} $largs $tf)}")
=C2=A0 =C2=A0 =C2=A0_tar_cache_name=3D$tf
=C2=A0 =C2=A0fi


It doesn't account for possible quoting on the command line.

If it's right, might I ask for someone to commit/push this, please?
Trying not to stretch myself too thin.=C2=A0 Thanks.

Cheers,

Daniel
--00000000000016d15705f093f103--