aboutsummaryrefslogtreecommitdiff
path: root/bp.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2023-05-16 20:03:11 -0400
committerBruce Hill <bruce@bruce-hill.com>2023-05-16 20:03:11 -0400
commit05dcacd94acb0695c68492b01051b310e5257a37 (patch)
treee50b550a5ae6a405f24c4d6d79b51cd45b6be7bb /bp.c
parent68f6218444376a72a485bfe56a6a163f10bddf20 (diff)
Respect $NO_COLOR
Diffstat (limited to 'bp.c')
-rw-r--r--bp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bp.c b/bp.c
index bd33e99..6adad36 100644
--- a/bp.c
+++ b/bp.c
@@ -647,7 +647,7 @@ int main(int argc, char *argv[])
if (options.context_after == USE_DEFAULT_CONTEXT) options.context_after = 0;
if (options.format == FORMAT_AUTO)
- options.format = isatty(STDOUT_FILENO) ? FORMAT_FANCY : FORMAT_BARE;
+ options.format = isatty(STDOUT_FILENO) ? (getenv("NO_COLOR") ? FORMAT_PLAIN : FORMAT_FANCY) : FORMAT_BARE;
// If any of these signals triggers, and there is a temporary file in use,
// be sure to clean it up before exiting.