diff options
author | Robert Estelle <robertestelle@gmail.com> | 2021-10-26 03:03:47 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-28 18:37:18 +0200 |
commit | de658515ae1166577441da09fe7624769e263a3e (patch) | |
tree | bd019e9daccc7e3f6340bccd4b3788434053ca80 /Documentation/config.txt | |
parent | color: support "default" to restore fg/bg color (diff) | |
download | git-de658515ae1166577441da09fe7624769e263a3e.tar.xz git-de658515ae1166577441da09fe7624769e263a3e.zip |
color: allow colors to be prefixed with "reset"
"reset" was previously treated as a standalone special color name
representing `\e[m`. Now, it can apply to other color properties,
allowing exact specifications without implicit attribute inheritance.
For example, "reset green" now renders `\e[;32m`, which is interpreted
as "reset everything; then set foreground to green". This means the
background and other attributes are also reset to their defaults.
Previously, this was impossible to represent in a single color:
"reset" could be specified alone, or a color with attributes, but some
thing like clearing a background color were impossible.
There is a separate change that introduces the "default" color name to
assist with that, but even then, the above could only to be represented
by explicitly disabling each of the attributes:
green default no-bold no-dim no-italic no-ul no-blink no-reverse no-strike
Signed-off-by: Robert Estelle <robertestelle@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/config.txt')
-rw-r--r-- | Documentation/config.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt index 636e722f30..f21790dd76 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -288,6 +288,11 @@ The position of any attributes with respect to the colors be turned off by prefixing them with `no` or `no-` (e.g., `noreverse`, `no-ul`, etc). + +The pseudo-attribute `reset` resets all colors and attributes before +applying the specified coloring. For example, `reset green` will result +in a green foreground and default background without any active +attributes. ++ An empty color string produces no color effect at all. This can be used to avoid coloring specific elements without disabling color entirely. + |