[Pkg-zsh-devel] Bug#1144635: Bug#1144635: zsh: broken by the FPATH environment variable defined by bash / lmod
Michael Prokop
mika at debian.org
Mon Aug 17 15:35:32 BST 2026
severity 1144635 important
thx
* Vincent Lefevre [Mon Aug 17, 2026 at 03:09:57PM +0200]:
> On a machine that has just been upgraded to trixie, I start zsh
> via a bash login shell (run by sshd). The issue is that when it
> is a login shell, bash defines the $FPATH environement variable
> to '/usr/share/lmod/lmod/init/ksh_funcs' as shown by
>
> echo "FPATH = '$FPATH'" >&2
>
> at the beginning of the ~/.bash_profile file, which outputs:
>
> FPATH = '/usr/share/lmod/lmod/init/ksh_funcs'
>
> This is possibly due to /usr/share/lmod/8.7.60/init/bash from the
> lmod package, as mentioned at
>
> https://github.com/direnv/direnv/issues/858
>
> (note that I'm not a direnv user... this was found by Google + AI).
Github is currently down
(https://www.githubstatus.com/incidents/zkxwbgr0cnmx),
so I can't check that reference.
But is it actually necessary and a good idea, that lmod
*exports* variables like that?
It looks like lmod pollutes the environment quiet a lot,
like e.g. also:
LMOD_SETTARG_FULL_SUPPORT=no
LMOD_VERSION=8.7.60
MODULEPATH_ROOT=/usr/share/modulefiles
LMOD_PKG=/usr/share/lmod/lmod
LMOD_ROOT=/usr/share/lmod
BASH_ENV=/usr/share/lmod/lmod/init/bash
LMOD_sys=Linux
MODULEPATH=/etc/lmod/modules:/usr/share/lmod/lmod/modulefiles/
LMOD_CMD=/usr/share/lmod/lmod/libexec/lmod
BASH_FUNC_ml%%=() { eval "$($LMOD_DIR/ml_cmd "$@")"
}
BASH_FUNC_module%%=() { if [ -z "${LMOD_SH_DBG_ON+x}" ]; then
case "$-" in
*v*x*)
__lmod_sh_dbg='vx'
;;
*v*)
__lmod_sh_dbg='v'
;;
*x*)
__lmod_sh_dbg='x'
;;
esac;
fi;
if [ -n "${__lmod_sh_dbg:-}" ]; then
set +$__lmod_sh_dbg;
echo "Shell debugging temporarily silenced: export LMOD_SH_DBG_ON=1 for Lmod's output" 1>&2;
fi;
eval "$($LMOD_CMD shell "$@")" && eval "$(${LMOD_SETTARG_CMD:-:} -s sh)";
__lmod_my_status=$?;
if [ -n "${__lmod_sh_dbg:-}" ]; then
echo "Shell debugging restarted" 1>&2;
set -$__lmod_sh_dbg;
fi;
unset __lmod_sh_dbg;
return $__lmod_my_status
}
> Such a setting completely breaks zsh, which outputs
>
> zsh:1: url-quote-magic: function definition file not found
>
> each time I type a key (the key has no other effect, i.e. the
> command line at the prompt remains empty, so I need to type Ctrl-D
> to quit zsh).
>
> It appears that instead of ignoring the $FPATH environment variable
> on startup, zsh sets $fpath to $FPATH.
Right.
> Note that the zshparam(1) man page says: "Some environment variables
> are not imported for reasons of security or because they would
> interfere with the correct operation of other shell features.",
> which should be the case here.
Do you mind brining this up to upstream yourself?
regards
-mika-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-zsh-devel/attachments/20260817/18cd3fc5/attachment.sig>
More information about the Pkg-zsh-devel
mailing list