You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: init/lmod/sh
+9-3Lines changed: 9 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@
25
25
# - The EESSI module also listens to environment variables so that it can be silently configured by a site
26
26
# - EESSI_MODULE_FAMILY_NAME: use the value of the environment variable to set an Lmod family for the EESSI module
27
27
# - EESSI_MODULE_STICKY: make the EESSI module sticky
28
-
# - EESSI_MODULE_UPDATE_PS1: have the EESSI module update PS1 to give a prompt that is prepended with "{EESSI/...} " (requires exporting PS1)
28
+
# - EESSI_MODULE_UPDATE_PS1: set to 1 (by default), the EESSI module prepends "{EESSI/...} " to PS1 (the shell prompt). Set to 0, PS1 remains unmodified.
29
29
# (- EESSI_MODULE_DEBUG_INIT: enable debug print statements when loading the EESSI module)
30
30
#
31
31
# Effects:
@@ -97,8 +97,14 @@ if [ -z "$__Init_EESSI_Default_Modules" ]; then
97
97
# For the shells that use PS1 for the prompt, let's add the trigger to enable updating that by default
98
98
# (in an interactive shell PS1 is likely unset, so let's only do this if it is set)
99
99
if [ -n"$PS1" ];then
100
-
export PS1
101
-
export EESSI_MODULE_UPDATE_PS1=1
100
+
if [ "${EESSI_MODULE_UPDATE_PS1-}"="0" ] ;then
101
+
# For certainty, we now unset it to guarantee it is not picked up by the EESSI module
102
+
# (this guarantees PS1 is not updated, even if it is exported externally to this script)
103
+
unset EESSI_MODULE_UPDATE_PS1
104
+
else
105
+
export EESSI_MODULE_UPDATE_PS1=1
106
+
export PS1
107
+
fi
102
108
fi
103
109
104
110
# Figure out which shell was used to source this script, which we then use to source the corresponding
0 commit comments