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

Re: whence not behaving as expected with noaliases set



On Sun, Nov 20, 2022 at 5:46 PM Matthew Martin <phy1729@xxxxxxxxx> wrote:
>
> On Sun, Oct 23, 2022 at 08:31:58PM +0200, Stefan Schmidt wrote:
> >
> > This works as expected if an alias is defined but if the `noaliases` option is set `whence` still returns the alias (same for `type`, `where` and `which`).
>
> > Am I misinterpreting or misunderstanding something here or is there in fact a contradiction between the documentation and the implementation?
>
> I think your interpretation is correct. This seems straight forward
> enough to fix.

I'm not sure there was intended to be an implication that "whence"
would pay attention to noaliases.  If used inside an "autoload -U"
function, for example, it's also going to report the "wrong" thing for
any command names used in that function, regardless of the global
setopt.

If we apply this change, I wonder if we should also extend the -a
option to continue to list aliases despite its current description of
"throughout the command path".  It already lists builtins as well as
$path locations.




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