summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6bdca89)
raw | patch | inline | side by side (parent: 6bdca89)
author | Junio C Hamano <junkio@cox.net> | |
Sat, 8 Jul 2006 00:48:02 +0000 (17:48 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 8 Jul 2006 00:48:02 +0000 (17:48 -0700) |
Even if the standard output is connected to a tty, do not
colorize the diff if we are talking to a dumb terminal when
diff.color configuration variable is set to "auto".
Signed-off-by: Junio C Hamano <junkio@cox.net>
colorize the diff if we are talking to a dumb terminal when
diff.color configuration variable is set to "auto".
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff.c | patch | blob | history |
index f0450a8b0bcefc336b6aa5e3d5122c1a3a39b1a4..aab246c97eb1660acfa231f7008180a12f6deb8d 100644 (file)
--- a/diff.c
+++ b/diff.c
if (!strcmp(var, "diff.color")) {
if (!value)
diff_use_color_default = 1; /* bool */
- else if (!strcasecmp(value, "auto"))
- diff_use_color_default = isatty(1);
+ else if (!strcasecmp(value, "auto")) {
+ diff_use_color_default = 0;
+ if (isatty(1)) {
+ char *term = getenv("TERM");
+ if (term && strcmp(term, "dumb"))
+ diff_use_color_default = 1;
+ }
+ }
else if (!strcasecmp(value, "never"))
diff_use_color_default = 0;
else if (!strcasecmp(value, "always"))