Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Path with spaces in _canonical_paths



Bart Schaefer wrote on Wed, Nov 23, 2022 at 15:12:40 -0800:
> On Wed, Nov 23, 2022 at 3:06 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > Anyway, I see you've extended it to clarify.  Thanks for this.
> 
> Remains to be seen if it works ... I still can't figure out how to
> cause that code path ("else") to be followed when I try to reproduce
> Thomas's error.

In the zsh tree,
.
    _f() { _canonical_paths tag desc $PWD/README }
    compdef _f f
    f <TAB>
.
is enough for me to get the else path to be taken.  For the variant with
-N and quoting,
.
    touch /tmp/My\ File
    ln -s /tmp slashtmp 
    compdef '_canonical_paths -N files files /tmp/My\ File' cmd
    cmd <TAB>
.
gives
.
     1	>>> files
     2	/tmp/My\ File     slashtmp/My File

That's with current HEAD and my nearly-minimal test setup (sets
little besides 'format', 'group-name', $PS1, $PS4, and $fpath).

Cheers,

Daniel





Messages sorted by: Reverse Date, Date, Thread, Author