fix error when adding package to env in container (#11321)

This commit is contained in:
Levi Baber 2019-05-02 11:04:21 -05:00 committed by GitHub
parent 309122c329
commit 9e72fc48c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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