Browse Source

[fix] do not colorize output on dumb terminals

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Markus Heiser 4 years ago
parent
commit
9c581466e1
1 changed files with 2 additions and 1 deletions
  1. 2 1
      searx/search/checker/__main__.py

+ 2 - 1
searx/search/checker/__main__.py

@@ -1,11 +1,12 @@
 import sys
+import os
 
 import searx.search
 import searx.search.processors
 import searx.search.checker
 
 
-if sys.stdout.isatty():
+if sys.stdout.isatty() and os.environ.get('TERM') not in ['dumb', 'unknown']:
     RESET_SEQ = "\033[0m"
     COLOR_SEQ = "\033[1;%dm"
     BOLD_SEQ = "\033[1m"