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

Re: [zsh 4.0.1 bug] filename completion

On Jun 26,  1:01am, Vincent Lefevre wrote:
} Subject: [zsh 4.0.1 bug] filename completion
} scripts/        share/          software/       sparc-solaris/  src/
} When I type "cd so", "cd sof", "cd softw", "cd softwa"... and try
} to complete, I get "cd software/". But when I type "cd soft" and
} try to complete, nothing happens. Note that here, soft is a named
} directory, but the above behaviour should be incorrect.

It took me a while to figure out which "above behavior" you meant.

The situation seems to be that you have CDABLE_VARS set and `soft' is
the name of the variable.

Either the handling of named directories by _cd is broken, or the
handling of named directories by _path_files is; I'm not sure which,
and it may even be both.

_cd doesn't even try to complete other directories if the prefix is the
name of a cdable variable, which is arguably wrong.

But even so, after _cd sets PREFIX="~$PREFIX" and calls _path_files, the
completion gets botched somehow ... _path_files calls (eventually the
equivalent of, at line 326)

    tmp1=( ~soft/ )
    compfiles -p tmp1 accex '' '' fake '*(-/)'

The trouble there seems to be that compfiles tries to match ~soft/*(-/) to
~soft and (obviously) fails.  The slash is getting added at line 254 of
_path_files; my guess is that needs to become conditional on whether the
prefix originally contained a slash, but that means in turn that the test
on line 255 has to change, etc.

I fooled around with _cd a bit and got something that works, but I'm not
happy with it, so I'm going to hope that Sven has a better idea of what's
going on.

Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   

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