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, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31654 invoked from network); 18 Nov 2022 17:41:53 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 18 Nov 2022 17:41:53 -0000 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:MIME-Version: Content-Transfer-Encoding:Content-Type:Date:Subject:Message-Id:To:From: 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=+4gRmBmV+H6BgNbXjvF2+gQN81UU92xTNYfuZO0ApB0=; b=hzAFK5N1ks+j3PqJV+CBHp0zT5 m1EThRZsNtiUuwikJ73NMX4eIOLIY+z8SGQSPiaoVfamVoramVg6WaCICb1daMP93Ku2kz1gJ7liB /Iw0EaUSO2XWukIRpUKLTAyzWRa1r7QeUwgbNmjltnbP3z9OKHXVYYU4Ac82S5tKjkK8s50JlY/jp 0togctFjAX0h/8QB5PHKDnnjvgXeh3GRc37IxILWeRaeqLmydBbeHGFUGgigCWaWKpcSmaDDx9RRE 9vVhYOCtbgwor5ka+o+4xZDi3tR/VoE4D//TKZRTDrGUjz1b7vRX+DuHRi3x67MjzeP8Vlfa9NJMK ocpweWmQ==; Received: by zero.zsh.org with local id 1ow5NA-000GcA-PT; Fri, 18 Nov 2022 17:41:52 +0000 From: To: zsh-workers@zsh.org Message-Id: Subject: Path with spaces in _canonical_paths Date: Fri, 18 Nov 2022 17:41:37 +0000 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7BIT MIME-Version: 1.0 X-Mailer: Sympa 6.2.68 X-Seq: 50996 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: Hi all, I'm trying to use `_canonical_paths` (on zsh 5.9) to let the user autocomplete a fixed list of files. I hope I'm not using it incorrectly. Otherwise: It seems to not escape spaces in paths appropriately. Short example: compdef '_canonical_paths -N files files /tmp/My\ File' cmd cmd Shows the following completions: /tmp/My File (appears twice) /tmp/My\ File i.e. I get in total 3 entries for the same path, and notably, the first option is without escaping the space, i.e. it will result in a command line: cmd /tmp/My File which is obviously not as intended. I tried scanning the code in /usr/share/zsh/functions/Completion/Unix/ _canonical_paths for the problem, but it is quite confusing to me. I was able to gather that by removing the `-Q` from the line _wanted "$tag" expl "$desc" compadd $__gopts -Q -U -a matches && ret=0 it adds escapes to all the entries, i.e. the new completions are: /tmp/My\ File (twice) /tmp/My\\\ File which is still not as desired. Much appreciated if anyone can help. Best, Thomas