diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/llnl/util/tty/color.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/spack/llnl/util/tty/color.py b/lib/spack/llnl/util/tty/color.py index 710196783d..51a5a1b5b1 100644 --- a/lib/spack/llnl/util/tty/color.py +++ b/lib/spack/llnl/util/tty/color.py @@ -263,7 +263,9 @@ def colorize( f"Incomplete color format: '{match.group(0)}' in '{match.string}'" ) - ansi_code = _escape(f"{styles[style]};{colors.get(color_code, '')}", color, enclose, zsh) + color_number = colors.get(color_code, "") + semi = ";" if color_number else "" + ansi_code = _escape(f"{styles[style]}{semi}{color_number}", color, enclose, zsh) if text: return f"{ansi_code}{text}{_escape(0, color, enclose, zsh)}" else: |