diff options
-rw-r--r-- | lib/spack/spack/environment.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/spack/spack/environment.py b/lib/spack/spack/environment.py index 62cad8545c..02b0a6d93c 100644 --- a/lib/spack/spack/environment.py +++ b/lib/spack/spack/environment.py @@ -125,7 +125,7 @@ def activate( cmds += 'setenv SPACK_OLD_PROMPT "${prompt}";\n' cmds += 'set prompt="%s ${prompt}";\n' % prompt else: - if 'color' in os.environ['TERM'] and prompt: + if os.getenv('TERM') and 'color' in os.getenv('TERM') and prompt: prompt = colorize('@G{%s} ' % prompt, color=True) cmds += 'export SPACK_ENV=%s;\n' % env.path |