summaryrefslogtreecommitdiff
path: root/qpid/python/qpid-python-test
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/python/qpid-python-test')
-rwxr-xr-xqpid/python/qpid-python-test7
1 files changed, 5 insertions, 2 deletions
diff --git a/qpid/python/qpid-python-test b/qpid/python/qpid-python-test
index ca6bec00fb..22063185b2 100755
--- a/qpid/python/qpid-python-test
+++ b/qpid/python/qpid-python-test
@@ -123,8 +123,11 @@ def is_included(path):
return True
return False
+def is_smart():
+ return sys.stdout.isatty() and os.environ.get("TERM", "dumb") != "dumb"
+
def width():
- if sys.stdout.isatty():
+ if is_smart():
s = struct.pack("HHHH", 0, 0, 0, 0)
fd_stdout = sys.stdout.fileno()
x = fcntl.ioctl(fd_stdout, termios.TIOCGWINSZ, s)
@@ -155,7 +158,7 @@ KEYWORDS = {"pass": (32,),
"ignored": (33,),
"selected": (34,)}
-COLORIZE = sys.stdout.isatty()
+COLORIZE = is_smart()
def colorize_word(word, text=None):
if text is None: