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>
Fri, 15 Sep 2017 18:09:23 +0000 (14:09 -0400)
commitfcc7e8dd427034be8727286306c78643da442d9c
tree4c9533bf73dcac26d163e50c98b28ebc61ab65ba
parent88a77ab5b605db02fa0b31096b604562cae1bf2b
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.024818 seconds and 5 git commands to generate.