-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Indirect zsh broken from bash starting from 8.7.42 #718
Comments
Set `__LMOD_SET_KSH_FPATH=1` to avoid setting FPATH in bash.
Temporary workaround for TACC/Lmod#718
I was able to reproduce this issue. I have created a branch called "IS718-FPATH" which has my fix. This fix works for me. Please test this branch out to see if it fixes it for you. Thanks very much for the bug report! |
@rtmclay thanks for the fix! But due to our unusual setup it doesn't work. We can workaround that however. The problem is that our We can, of course, change the module that provides zsh to do the FPATH manipulation itself. |
I don't run your setup so I can't reproduce exactly what you have but:
As you can see I run zsh as my shell. Then I start bash. unset the one-time flag and export FPATH to point to the KSH_FUNCS. Then I start zsh and it works. Make sure that you have this in your init/zsh file:
The unsetting of FPATH fixes the problem for me. |
Our However the user that complained saw the behaviour with plain
? (Yes I do realize |
For a different reason. I have remove the guard variable (__LMOD_SET_ZSH_FPATH) as they don't work in another setting. With the newest update to the IS718-FPATH branch I get for the account rtmbash which runs bash as its shell:
|
I'm interested in what happens to I'll test IS718-FPATH in any case to see what happens. |
I have merge the IS718-FPATH branch on to the main branch. Thanks for submitting this issue! |
Thank you for the fixes. My solution (that only applies to our local situation) is to mimic the bash logic in a module file via
(https://github.com/ComputeCanada/software-stack-custom/pull/78/files) |
This reverts commit 0ae3882. We don't need it any more because of ComputeCanada/software-stack-custom#78
The change in question: if type zsh > /dev/null 2>&1; then instead of: type zsh > /dev/null 2>&1
if [ "$?" = 0 ]; then |
I have updated the IS718-FPATH branch to change from using the exit status to changes similar to the one you have suggested. This was done in two places. Please test the latest update of this branch to see if works for you. |
after patch of |
I am closing this issue. If there are any new issues that come up this issue can be reopened. |
Describe the bug
given a
bash
login shell I getFPATH=/cvmfs/soft.computecanada.ca/custom/software/lmod/lmod/init/ksh_funcs
.This in turn breaks
zsh
when started frombash
as it can't find functions any more from its default, particularly if .zshrc is empty you get an error straightaway.It's triggered by this block in
bash.in
;KSH_VERSION
andFPATH
are empty when it is encountered andBASH_VERSION
is set (5.1.8(1)-release
)https://github.com/TACC/Lmod/blob/main/init/bash.in#L41C1-L46C4
before 8.7.42 this block wasn't there; a different block didn't change FPATH at all, because it wasn't triggered:
https://github.com/TACC/Lmod/blob/8.7.41/init/bash.in#L26C1-L29C24
To Reproduce
in bash:
Expected behavior
zsh should start normally
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: