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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20650 invoked from network); 21 Nov 2022 10:48:56 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Nov 2022 10:48:56 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1669027737; b=i6tUmmc+Iu59KbgrokfNdqZR5ZTqfvFOnTQVsAhOuFH8vPWqMGV6RcoizEWMXXkoiS3bjWvIro aYVIXz42r/HYDHJApRHPfQzGt1njCCDT/d9TGu5Gtugvsqu8LLmrucMqHh71BW71ObFN/NIfcv k8nlXbr67p0NFihrdnpOy8yqy28pN8qljc+3UpeqFB6fPRXvjMZrlYqvBMOfgITziiigNwLt3u G03fcT44xNilhF0nfELIFBbrsKCrXouAIkiaaFTrrdSyAs1XKP4BwwLP6YHYFn1pEb10tQjwmD JAkRN8KkSErJjM1gVbxtr+6XybpSO1CfKS9j1phr546xhA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (coldfix.de) smtp.remote-ip=37.120.171.171; dkim=pass header.d=coldfix.de header.s=mail header.a=rsa-sha256; dmarc=pass header.from=coldfix.de; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1669027737; bh=IfqdNPqwN2LNHUI2w32OMHY3+Z5FX/v8G7fVF5jjT/w=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To: References:To:Subject:From:MIME-Version:Date:DKIM-Signature:Message-ID: DKIM-Signature; b=PULrIDGJUAtT2wSHAgI/qbKB4ZnvomIsoo5gnZ53TYpf/xt1NRd+qIeqTyr5deigdA5R96t9Xq SBMDpP1mANMR2IDpsCEu1gHbJ9m3/l2g5S/Or4RL8IKVUYGyN98fencFfM/vEugNl3vYvd8SPc krRR1JMO+WqiZKcAOwf6jVjRhUv1f6oSHK0xebvR50yLJKHeGLBR6Swn4OAZ4cRG9OXTR3yajC AUQk9agmXL4kPV5fKFtDLeXkIt8z1eyZ/0sOdaS9Wpq4NyCoVj/ExwNA9hFd7jlh/FUSMvxtQG 8uU7M8H4UkeaQufgA4MG6kCALIAI4bugcy2ctisBgyb9CA==; 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:References:To:Subject:From: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=zA04e87mcfvJO3+88C5CYt535gCLHC+JzfWZ+rFI4YM=; b=C/GsDBs4URpVvGyBHWQoVWwbsl rzD+tuFz+uXQ+Ee6Roem2VqGjv+Uq3OweTiD0ZMMI07jkJbz6/fGNmnp488fJAWPXxqJ/FVKi1ZR1 V0BwQSvo7jW2cKMACwvzd7NveDqpHH22e0G4J8euBdpaGOk9+jXz7x+rySZgEDUmzZpqYXAAWdxEP HH9UbAb/Jp8I5OlDZQiatd7vXV2ntQuGoEE852JcNSASpymBAHx1LsuHKn64/1dyOMngm9kS9d4tz GqtqdzbYCj1Ef5bJtc2Naedf8kuqwsq08tpojg6HOi5E0Nl+M8OTRDrmuragATeMFRIFluZDenPXI rj8NpI3A==; Received: by zero.zsh.org with local id 1ox4MB-0005wL-9L; Mon, 21 Nov 2022 10:48:55 +0000 Authentication-Results: zsh.org; iprev=pass (coldfix.de) smtp.remote-ip=37.120.171.171; dkim=pass header.d=coldfix.de header.s=mail header.a=rsa-sha256; dmarc=pass header.from=coldfix.de; arc=none Received: from coldfix.de ([37.120.171.171]:60124 helo=mail.coldfix.de) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1ox4LZ-0005S4-VC; Mon, 21 Nov 2022 10:48:18 +0000 Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=coldfix.de; s=mail; t=1669027695; bh=IfqdNPqwN2LNHUI2w32OMHY3+Z5FX/v8G7fVF5jjT/w=; h=From:Subject:To:References:In-Reply-To; b=j93rVyUhlsxyhV6ctNKHXZtNv+BczMekZrEbSIfWy88ptOyq3ZuiptVZrzhrt3Z3l 0BMiTi1hGZjFQz1EAoDbmwZYynsTgzRNbCPgdivViTDzgEeKBrgWyYOpPVlDl/JxHS qMFGmnZTMqzWg7xlLc68fUZQqQT+Wls7nlxdWdLyR2x4uNNBTefS7EneReRdUtTNHr YFkpiQb6r5Czj3HLh863pBlTzAGFMcNGT6zCWZIIShdj1sqTS3vfilqiocJT9tvSyN ULWVaoQu9KD8wA/yjQt3zEaDhxbpDzULPRGaihNw1DUryLp2n+0eG0brZFjT6FBnbh Y+ZQxPSNADQwagg3v64peq05Vipzi2xovE9cagIMwUhUbKnWGNZJQUWK348Z9eaBIz WmnVtpqDBpzvlojXDWR7easPJGY1Bf+TBtQjYLXdLyeQcBFPTfGl9a/LGHiO3vZtUC dB/WiNvJOgubDodt163bvE4B3bSkjLFEEcORvc1QBgYwYceWswqimws85yw466YxnE cMXkgj45c12BpCuyMXNVxigm3k+Zu6DzBTRGcAgrSKMVjSxTkmatvAklHjjVclBlxA 4Qd1vk9IOiPS0Mdbfo3ZahE+FBirBZfaJCu3/tdaJx46fgFU3+UYuOVfWr0YsHb/Ko gL+MmWXZj9Wuy01yBZSiRhPU= Date: Mon, 21 Nov 2022 11:47:48 +0100 Mime-Version: 1.0 From: thomas@coldfix.de Subject: Re: Path with spaces in _canonical_paths To: zsh-workers@zsh.org References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Seq: 51014 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: > I'm not able to reproduce this using nothing but compinit plus the > compdef above. I get just one completion, "/tmp/My\ File", regardless > of whether that file exists or not. > > Try this: > > debug_canonical_paths () { > _canonical_paths -N files files /tmp/My\ File > } > compdef '_complete_debug debug_canonical_paths' cmd Thanks for your answer! I can't reproduce with the minimal example anymore either. However, I still get similar behaviour by first doing: sudo ln -s /tmp /foo And then, same as before (with or without debug, with or without extra function, with or without -N): debug_canonical_paths () { _canonical_paths -N files files /tmp/My\ File } compdef '_complete_debug debug_canonical_paths' cmd cmd Results in: /foo/My File /tmp/My\ File This is with blank zsh configuration `zsh -f` plus: autoload -U compinit; compinit > Pressing TAB then drops a file in /tmp with a debug trace of the > execution of _canonical_paths. In particular look at which "zstyle" > lookups are being done and which of those might be causing the extra > entries. You can also look at the context around elements being added > to the "matches" array. The trace shows: +_canonical_paths_add_paths:19> '(anon)' [...] +(anon):3> matches+=( '/tmp/My\ File' ) but later: +_canonical_paths_add_paths:28> matches+=( '/foo/My File' ) which explains why `compadd -Q` handles those differently. So the different unintended behaviour seems to appear only in the "alternative" paths. I originally encountered this behaviour with a file in /var/run/media/thomas/ which is symlinked to /media on my system. I get the same problem with files in /usr/bin/ which has several symlinks /usr/sbin/, /bin, /sbin on archlinux. I suspect when I previously also got a similar behaviour with my original minimal example without the symlink, there might have been tmpfs remounts or something(?), not sure what has changed, I did reboot in between. Best, Thomas