* Vincent Lefevre [Mon Aug 17, 2026 at 07:32:22PM +0200]: > On 2026-08-17 16:35:32 +0200, Michael Prokop wrote:
> > But is it actually necessary and a good idea, that lmod
> > *exports* variables like that?
>
> Probably not. IMHO, the right solution would be to ask lmod users
> to run something like "source ..." from their own init file.
>
> Moreover, while I don't know what lmod's FPATH-related code should
> do, it does not seem to behave as intended:
>
> unset __zsh_fpath
> if [ -n "${ZSH_VERSION+x}" ] && ! (autoload -U compinit && compinit -C 2>
> /dev/null) ; then
> __zsh_fpath=$(unset FPATH; zsh -f -c 'echo $FPATH')
> fi
> export FPATH=$(/usr/share/lmod/lmod/libexec/addto --append FPATH
> ${__zsh_fpath:-$FPATH} /usr/share/lmod/lmod/init/ksh_funcs)
> unset __zsh_fpath
>
> The goal of the
>
> __zsh_fpath=$(unset FPATH; zsh -f -c 'echo $FPATH')
>
> seems to get zsh's default $FPATH (for the first zsh in $PATH), so
> that the lmod specific paths are appended. But what I can see is that
> zsh's default $FPATH is overridden, because the "export FPATH=..." is
> outside the "if". In any case, such a solution is ugly as if the user
> has another zsh version installed on their machine and wants to run
> it, the $FPATH (assuming that the intent of zsh is to honor it, which
> I think is a major design bug) would be incorrect for the paths
> associated with the zsh installation.
Yes, IMO that's wrong behavior of lmod.
> > Do you mind brining this up to upstream yourself?
>
> I've posted a message to zsh-workers and put the URL in "forwarded".
Thanks, appreciated.
I agree with what Eric replied in
https://www.zsh.org/mla/workers/2026/msg00940.html:
| 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.
(and further)
I'd suggest we re-assign this to lmod?
regards
-mika-
signature.asc
Description: PGP signature

