From ead88ed66d15cbf92c165092dff86fbef071ff9b Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Thu, 18 Jan 2018 14:41:45 +1100 Subject: [PATCH] Support forcing colorama colors on. This is needed if you want colors but are using pipes and similar. --- litex/build/xilinx/common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/litex/build/xilinx/common.py b/litex/build/xilinx/common.py index 170e67e25..4c59a9983 100644 --- a/litex/build/xilinx/common.py +++ b/litex/build/xilinx/common.py @@ -2,7 +2,11 @@ import os import sys try: import colorama - colorama.init() # install escape sequence translation on Windows + # install escape sequence translation on Windows + if os.getenv("COLORAMA", "") == "force": + colorama.init(strip=False) + else: + colorama.init() _have_colorama = True except ImportError: _have_colorama = False