Fix: common: improve color support handling
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 16 Aug 2017 19:06:55 +0000 (15:06 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 17 Sep 2017 18:10:50 +0000 (14:10 -0400)
commit692cc7b646a796e0ba4e54c12ef60eb5ca7a4284
tree466d19e260ce56b5915f3303e7285f446f1a5569
parentcb2a67526db4941a22ba347216c198a4e8094e96
Fix: common: improve color support handling

With this patch, terminal color codes are emitted by Babeltrace modules
if the `BABELTRACE_TERM_COLOR` environment variable is set to `ALWAYS`
or if all the following conditions are satisfied:

1. The `BABELTRACE_TERM_COLOR` environement variable is not set to
   `NEVER`.
2. The `TERM` environment variable starts with `xterm`, `rxvt`,
   `konsole`, `gnome`, `screen`, `tmux`, or `putty`.
3. For both the standard output and error streams: its file descriptor
   is a TTY.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
common/common.c
This page took 0.02486 seconds and 4 git commands to generate.