From 8a8f30679d65fb9e06a7a5446ff0d24b973ea79b Mon Sep 17 00:00:00 2001 From: Tomas Korbar Date: Thu, 17 Jan 2019 17:10:01 +0100 Subject: [PATCH] Fix problems with CHEATCOLORS behaviour --- cheat/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cheat/utils.py b/cheat/utils.py index 3a5b83a..59d062e 100644 --- a/cheat/utils.py +++ b/cheat/utils.py @@ -33,7 +33,8 @@ class Utils: """ Colorizes cheatsheet content if so configured """ # only colorize if configured to do so, and if stdout is a tty - if not self._displaycolors or not sys.stdout.isatty(): + if (self._displaycolors not in ["True", "true", "1", 1] or + not sys.stdout.isatty()): return sheet_content # don't attempt to colorize an empty cheatsheet