about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lr.13
-rw-r--r--lr.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/lr.1 b/lr.1
index a673036..920b2fd 100644
--- a/lr.1
+++ b/lr.1
@@ -115,6 +115,9 @@ Don't enter directories.
 .It Fl G
 Colorize output to TTY.
 Use twice to force colorized output.
+If the environment variable
+.Ev NO_COLOR
+is set, colors are never used.
 .It Fl X
 Output OSC 8 hyperlinks to TTY.
 Use twice to force hyperlinks.
diff --git a/lr.c b/lr.c
index 06b70ca..774b1d2 100644
--- a/lr.c
+++ b/lr.c
@@ -2468,6 +2468,8 @@ main(int argc, char *argv[])
 		if (Xflag == 1)
 			Xflag = 0;
 	}
+	if (getenv("NO_COLOR"))
+		Gflag = 0;
 
 	analyze_format();
 	if (Uflag) {