pager: config variable pager.color
enable/disable colored output when the pager is in use Signed-off-by: Matthias Lederhofer <matled@gmx.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
9590b041ea
commit
aa086eb813
2
diff.c
2
diff.c
@ -175,7 +175,7 @@ int git_diff_ui_config(const char *var, const char *value)
|
||||
diff_use_color_default = 1; /* bool */
|
||||
else if (!strcasecmp(value, "auto")) {
|
||||
diff_use_color_default = 0;
|
||||
if (isatty(1) || pager_in_use) {
|
||||
if (isatty(1) || (pager_in_use && pager_use_color)) {
|
||||
char *term = getenv("TERM");
|
||||
if (term && strcmp(term, "dumb"))
|
||||
diff_use_color_default = 1;
|
||||
|
Reference in New Issue
Block a user