diff options
author | Robert Estelle <robertestelle@gmail.com> | 2021-10-25 22:32:36 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-28 09:37:08 -0700 |
commit | 05f1f41c9b02b916a5f03c5658bec3270ac3684d (patch) | |
tree | 1f56c22fefc92aca90f426a61c7505a144a05976 /color.h | |
parent | aeefc1866c7f98ac76aac66b92cc142b8135054e (diff) | |
download | git-05f1f41c9b02b916a5f03c5658bec3270ac3684d.tar.gz |
color: support "default" to restore fg/bg color
The name "default" can now be used in foreground or background colors,
and means to use the terminal's default color, discarding any
explicitly-set color without affecting the other attributes. On many
modern terminals, this is *not* the same as specifying "white" or
"black".
Although attributes could previously be cleared like "no-bold", there
had not been a similar mechanism available for colors, other than a full
"reset", which cannot currently be combined with other settings.
Note that this is *not* the same as the existing name "normal", which is
a no-op placeholder to permit setting the background without changing
the foreground. (i.e. what is currently called "normal" might have been
more descriptively named "inherit", "none", "pass" or similar).
Signed-off-by: Robert Estelle <robertestelle@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'color.h')
-rw-r--r-- | color.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -32,6 +32,7 @@ struct strbuf; #define GIT_COLOR_MAGENTA "\033[35m" #define GIT_COLOR_CYAN "\033[36m" #define GIT_COLOR_WHITE "\033[37m" +#define GIT_COLOR_DEFAULT "\033[39m" #define GIT_COLOR_BOLD_BLACK "\033[1;30m" #define GIT_COLOR_BOLD_RED "\033[1;31m" #define GIT_COLOR_BOLD_GREEN "\033[1;32m" @@ -40,6 +41,7 @@ struct strbuf; #define GIT_COLOR_BOLD_MAGENTA "\033[1;35m" #define GIT_COLOR_BOLD_CYAN "\033[1;36m" #define GIT_COLOR_BOLD_WHITE "\033[1;37m" +#define GIT_COLOR_BOLD_DEFAULT "\033[1;39m" #define GIT_COLOR_FAINT_BLACK "\033[2;30m" #define GIT_COLOR_FAINT_RED "\033[2;31m" #define GIT_COLOR_FAINT_GREEN "\033[2;32m" @@ -48,6 +50,7 @@ struct strbuf; #define GIT_COLOR_FAINT_MAGENTA "\033[2;35m" #define GIT_COLOR_FAINT_CYAN "\033[2;36m" #define GIT_COLOR_FAINT_WHITE "\033[2;37m" +#define GIT_COLOR_FAINT_DEFAULT "\033[2;39m" #define GIT_COLOR_BG_BLACK "\033[40m" #define GIT_COLOR_BG_RED "\033[41m" #define GIT_COLOR_BG_GREEN "\033[42m" @@ -56,6 +59,7 @@ struct strbuf; #define GIT_COLOR_BG_MAGENTA "\033[45m" #define GIT_COLOR_BG_CYAN "\033[46m" #define GIT_COLOR_BG_WHITE "\033[47m" +#define GIT_COLOR_BG_DEFAULT "\033[49m" #define GIT_COLOR_FAINT "\033[2m" #define GIT_COLOR_FAINT_ITALIC "\033[2;3m" #define GIT_COLOR_REVERSE "\033[7m" |