broken by the FPATH environment variable defined by bash / lmod

Vincent Lefevre <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <[email protected]>
FYI, I've just reported the following bug:

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1144635

Package: zsh
Version: 5.9-8+b23
Severity: serious
Tags: upstream

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).

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.

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.

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.