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

Re: broken by the FPATH environment variable defined by bash / lmod



On Tue, Aug 18, 2026 at 1:36 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
>
> On 2026-08-17 15:56:23 -0400, Eric Cook wrote:
> > On 8/17/26 9:17 AM, Vincent Lefevre wrote:
> > > This is possibly due to /usr/share/lmod/8.7.60/init/bash from the
> > > lmod package, as mentioned at
> >
> > if bash learned about FPATH and autoloadable functions, then like
> > other shell variables, it shouldn't be exported (without good
> > reason) and that file is the problem.
>
> In the present case, I agree. But imagine that someone who doesn't
> know anything about zsh uses FPATH as an environment variable for
> their own use. This would break zsh scripts that use functions, like
>
> ----------------------------------------
> #!/usr/bin/env zsh
> autoload -U is-at-least
> is-at-least 5 && echo OK
> ----------------------------------------
>
> $ export FPATH=foo
> $ ./some-script
> is-at-least:4: is-at-least: function definition file not found
>
> Or do you assume that FPATH should universally be known?

https://lmod.readthedocs.io/en/latest/search.html?q=FPATH
It seems it is at least known by the software in question, though the
answer in the FAQ is pretty confusing, claiming it supports zsh and
then telling you to unset FPATH manually.

-- 
Mikael Magnusson




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