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

Re: [FEATURE][PATCH] Complete local executables with ./ prefix, if prefix-needed is false

Aaron Schrab wrote on Wed, 08 Dec 2021 01:16 +00:00:
> [...] enabling this option would generally be a one-time thing for
> a user, and they may not consider this type of case at the time, and
> after awhile even forget about it.

Furthermore, anyone who has already added «zstyle ':…:*' prefix-needed
false» to their zshrc will silently get the new behaviour when they upgrade.


I'm not sure how intuitive the new behaviour is.  First, other uses of
prefix-needed generally hide a tag from the matches unless the common
prefix of all matches in that tag is typed; that is, those uses of prefix-needed
could be simulated with a «zstyle -e … tag-order …» setting that
conditionally excludes "signals" or "options" depending on $PREFIX et
al..  This patch's use does not follow that pattern: if the style is set
to true, setting it to false would not cause files in $PWD to be offered
as matches immediately.

That makes me wonder whether a better approach here would be to complete
both executables in $PATH and executables in $PWD, but under separate
tags.  If we did that, prefix-needed would have its usual semantics in
this case.

Second, if Alice's $PATH does not include "." and her zstyle settings
are such that «zstyle -T :…:executables prefix-needed» is false, why
should the implied prefix be "./"?



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