From 57392d313d810fb1f4532526c99cea5fbd901c84 Mon Sep 17 00:00:00 2001 From: chaseleif Date: Wed, 27 Nov 2024 19:29:15 -0600 Subject: [PATCH] Add note regarding alias behavior for spacktivate in non-interactive shells --- tutorial_environments.rst | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tutorial_environments.rst b/tutorial_environments.rst index a603823286..bbe91c5ea4 100644 --- a/tutorial_environments.rst +++ b/tutorial_environments.rst @@ -93,14 +93,20 @@ command: .. literalinclude:: outputs/environments/env-activate-1.out :language: console - -You can also use the ``spacktivate`` alias for short. - .. note:: If you use the ``-p`` option for ``spack env activate``, Spack will prepend the environment name to the prompt. This is a handy way to be reminded if and which environment you are in. +You can also use the shorter ``spacktivate`` alias for ``spack env activate``. + +.. note:: + Alias behavior may vary depending on the shell interpreter used. In Bash, + use of aliases requires the shell option ``expand_aliases`` to be set. + This option is set by default, but it is not set in non-interactive shells, + e.g., when executing a Bash script. In a Bash script, ``expand_aliases`` + can be set with the command ``shopt -s expand_aliases``. + Once you activate an environment, ``spack find`` only shows what is in the current environment. We just created this environment, so it