From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 74B7421D12 for ; Wed, 10 Apr 2024 13:02:57 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1712746977; b=VMQJJXDJOwJ7AT1E3lLUCBPXoiY/6I9n1Uf+QRWDBMqEaX6HJLqQ8NE9k4BygukjuFhfXj5rcm WkB85SQBl5qp3JbyJelZIXlpt8Rqysfg2fU1iMrzIPk0FPad+NG50g0uCHHv20DIA6ryh8hRB1 rhena/B1jFOlygRJ8ynTFNS4uiE3qRSEaF48OsUGgqxf0MiDa1YlScuWFqP/j80uMEGc/BSPPz gBwSqtk1ZO9vE+xXbnupfbazW+mD5hg9OsHU5o9kV2T/b5ljKbkC7ciBdwVWxcv7NncPvheWKw yruRnCvHmMWpmgmML3OREhbTvZ3wkL0QzPHWuu+Ka7CEFQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out-183.mta0.migadu.com) smtp.remote-ip=91.218.175.183; dkim=pass header.d=fugi.dev header.s=key1 header.a=rsa-sha256; dmarc=pass header.from=fugi.dev; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1712746977; bh=Brl4bCbLDFw/qc/93LNd0JRKE74y6cRlhrYEh0yQdmE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Subject:From:To: MIME-Version:Date:DKIM-Signature:Message-ID:DKIM-Signature; b=hq1sENEHypNH3fPJ+rVU7btzzmT9iwY9po9CvX/yYunNmSu0B+nKMuLc00Q2+BMvOgOSgo/2Pq IpAE6JY7L/PFPYBkDzjR7mP8/z7V8CsdngKijEB3gjEX9yXcDAJt7jMwtFLEAn37nonoRHLFOq v0PwMjjoXdRV1AXTcPHWoOArgz44gNZ4OjQcvsviBvtKZ0bNUgPwLg1z3ZaWGzbYD0CosuXUUq 12dtkSI20lH/oHblxBkSbc2YAtRXLT0KgisASxneJIuEvA8IepTzmfnCPdjmXzAni6ILkAhnQv Iv8JrrFwISriA9d8PIf/k3JoWdJH9L9wkPWhRCdi2/zUVQ==; 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:Subject:From:To: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:In-Reply-To:References; bh=aCimK1HMGoVAe9A7shXfXTa4uwdm5o0sl9EEOdISdDg=; b=QW/zHnvMpyOCu+rCByhgAiOWJG bLV+/12PWx7DPtudDMGTFZewdFtcBEQD4JQ2Vtw8o+2506KNv00fRUnwpcJI1w8MeiYz7ANa/SAaw RtnTGSE0XkSQwXPWmHc5ad+ChNh1B667s5IzC83Dy6yn8cInwsfKUL3QUrENQ5hryyxsXtam4q7cx 4IqbZCZwyTD4qZF8cqXi9nAPzch7lN3XPrH4W879+4Uq6yIx0IRTQ+5eqTLh3E9tu3aq4i1ij8AoF fXPLepIWVpjcwSO5e5uqb9/pMEhVGBFQ5FOj1U08PQ7K46mutBjJiTdQqL8NdVHzry+USzeYLK4NE XMMADTkQ==; Received: by zero.zsh.org with local id 1ruVjE-0009R4-FW; Wed, 10 Apr 2024 11:02:56 +0000 Authentication-Results: zsh.org; iprev=pass (out-183.mta0.migadu.com) smtp.remote-ip=91.218.175.183; dkim=pass header.d=fugi.dev header.s=key1 header.a=rsa-sha256; dmarc=pass header.from=fugi.dev; arc=none Received: from out-183.mta0.migadu.com ([91.218.175.183]:11849) (DNSSEC AD) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1ruVTg-0008UG-T9; Wed, 10 Apr 2024 10:46:53 +0000 Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fugi.dev; s=key1; t=1712746011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aCimK1HMGoVAe9A7shXfXTa4uwdm5o0sl9EEOdISdDg=; b=g3Okb42QizEHax/TTPWoKEH8EbXsS1JansRpbbjzNVpRZM2vui8VBV2xgchpnjHC3efjai NRFKJhyKn8Xu+oS1YnrdfUkGq2iGoU1hfuDIOhinBUdKf7/7pZsGzqkWTwmpeyjOofclkD AAfi69VFRH6FggLkfAF8aU7Imfqlsp4= Date: Wed, 10 Apr 2024 12:46:48 +0200 MIME-Version: 1.0 Content-Language: en-US, de-DE To: zsh-workers@zsh.org X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Lyn Fugmann Subject: [PATCH] remote files completion: remove double-escaping Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Seq: 52884 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: Removes the double escaping in the remote files completion. This affects rsync and scp. For example, instead of a space character in a remote filename turning into `\\\ `, it will now correctly turn into `\ `. While scp apparently works with either one, rsync requires the latter since version 3.2.4[1] (unless the legacy behavior is explicitly enabled). This has been a problem for almost two years now. [1]: https://download.samba.org/pub/rsync/NEWS#3.2.4 diff --git a/Completion/Unix/Type/_remote_files b/Completion/Unix/Type/_remote_files index 93e1b7f43..4d4a7abbf 100644 --- a/Completion/Unix/Type/_remote_files +++ b/Completion/Unix/Type/_remote_files @@ -60,10 +60,7 @@ if zstyle -T ":completion:${curcontext}:files" remote-access; then dirprefix=${dir}/ fi - if [[ -z $QIPREFIX ]] - then rempat="${dirprefix}${PREFIX%%[^./][^/]#}\*" - else rempat="${dirprefix}${(q)PREFIX%%[^./][^/]#}\*" - fi + rempat="${dirprefix}${(q)PREFIX%%[^./][^/]#}\*" # remote filenames remfiles=(${(M)${(f)"$( @@ -92,9 +89,9 @@ if zstyle -T ":completion:${curcontext}:files" remote-access; then while _tags; do while _next_label remote-files expl ${suf:-remote directory}; do [[ -n $suf ]] && - compadd "$args[@]" "$expl[@]" -d remdispf -- ${(q)remdispf%[*=|]} && ret=0 + compadd "$args[@]" "$expl[@]" -d remdispf -- ${remdispf%[*=|]} && ret=0 compadd ${suf:+-S/} $autoremove "$args[@]" "$expl[@]" -d remdispd \ - -- ${(q)remdispd%/} && ret=0 + -- ${remdispd%/} && ret=0 done (( ret )) || return 0 done