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
- X-seq: zsh-workers 49640
- From: "Daniel Shahaf" <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [FEATURE][PATCH] Complete local executables with ./ prefix, if prefix-needed is false
- Date: Wed, 08 Dec 2021 16:25:00 +0000
- Archived-at: <https://zsh.org/workers/49640>
- In-reply-to: <YbAHa8bRRd/Mgb3B@pug.qqx.org>
- List-id: <zsh-workers.zsh.org>
- References: <CAHLkEDsOfypLT9BSb4fRHTGXpz3btuFPZAbJos8XahsP4-uajg@mail.gmail.com> <Ya/6zqAXHihSSbtT@pug.qqx.org> <CAH+w=7YC2cQCg2XJKAvpGkhUfuVt_A_oMkB-t9=HAQt-SikFrA@mail.gmail.com> <YbAHa8bRRd/Mgb3B@pug.qqx.org>
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 "./"?
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author