diff options
author | itchyny <itchyny@cybozu.co.jp> | 2023-08-05 19:18:07 +0900 |
---|---|---|
committer | Nico Williams <nico@cryptonector.com> | 2023-08-05 23:21:12 -0500 |
commit | a6920601299913ec5f9c9a8883517ec10dd71ffe (patch) | |
tree | abe1dbc2eb65473186a4962dd4ff156562c2a5e3 | |
parent | f94a9d463ffb3422861a0da140470dbf5ce76632 (diff) |
Change the default color of null to Bright Black
-rw-r--r-- | NEWS.md | 4 | ||||
-rw-r--r-- | docs/content/manual/manual.yml | 2 | ||||
-rw-r--r-- | jq.1.prebuilt | 2 | ||||
-rw-r--r-- | src/jv_print.c | 2 | ||||
-rwxr-xr-x | tests/shtest | 18 |
5 files changed, 14 insertions, 14 deletions
@@ -26,8 +26,8 @@ Full commit log can be found at <https://github.com/jqlang/jq/compare/jq-1.6...j - Make object key color configurable using `JQ_COLORS` environment variable. @itchyny @haguenau @ericpruitt #2703 ```sh - # this would make "field" yellow (33, the last value) - $ JQ_COLORS="1;30:0;37:0;37:0;37:0;32:1;37:1;37:1;33" ./jq -n '{field: 123}' + # this would make "field" bold yellow (`1;33`, the last value) + $ JQ_COLORS="0;90:0;37:0;37:0;37:0;32:1;37:1;37:1;33" ./jq -n '{field: 123}' { "field": 123 } diff --git a/docs/content/manual/manual.yml b/docs/content/manual/manual.yml index 4028a943..d5e625c1 100644 --- a/docs/content/manual/manual.yml +++ b/docs/content/manual/manual.yml @@ -3656,7 +3656,7 @@ sections: - color for object keys The default color scheme is the same as setting - `JQ_COLORS="1;30:0;37:0;37:0;37:0;32:1;37:1;37:1;34"`. + `JQ_COLORS="0;90:0;37:0;37:0;37:0;32:1;37:1;37:1;34"`. This is not a manual for VT100/ANSI escapes. However, each of these color specifications should consist of two numbers separated diff --git a/jq.1.prebuilt b/jq.1.prebuilt index 48b76220..99c35dbe 100644 --- a/jq.1.prebuilt +++ b/jq.1.prebuilt @@ -4046,7 +4046,7 @@ color for object keys .IP "" 0 . .P -The default color scheme is the same as setting \fBJQ_COLORS="1;30:0;37:0;37:0;37:0;32:1;37:1;37:1;34"\fR\. +The default color scheme is the same as setting \fBJQ_COLORS="0;90:0;37:0;37:0;37:0;32:1;37:1;37:1;34"\fR\. . .P This is not a manual for VT100/ANSI escapes\. However, each of these color specifications should consist of two numbers separated by a semi\-colon, where the first number is one of these: diff --git a/src/jv_print.c b/src/jv_print.c index d1db88aa..4b757d7c 100644 --- a/src/jv_print.c +++ b/src/jv_print.c @@ -30,7 +30,7 @@ static char color_bufs[8][16]; static const char *color_bufps[8]; static const char* def_colors[] = - {COL("1;30"), COL("0;37"), COL("0;37"), COL("0;37"), + {COL("0;90"), COL("0;37"), COL("0;37"), COL("0;37"), COL("0;32"), COL("1;37"), COL("1;37"), COL("1;34")}; #define FIELD_COLOR (colors[7]) diff --git a/tests/shtest b/tests/shtest index ea6bc900..ee6cb36e 100755 --- a/tests/shtest +++ b/tests/shtest @@ -417,7 +417,7 @@ unset JQ_COLORS ## Default colors, null input $JQ -Ccn . > $d/color -printf '\033[1;30mnull\033[0m\n' > $d/expect +printf '\033[0;90mnull\033[0m\n' > $d/expect cmp $d/color $d/expect ## Set non-default color, null input @@ -438,27 +438,27 @@ $JQ -Ccn '[{"a":true,"b":false},123,null]' > $d/color printf '[0m\033[1;37m\033[1;37' printf 'm}\033[0m\033[1;37m,\033[' printf '0;37m123\033[0m\033[1;' - printf '37m,\033[1;30mnull\033' + printf '37m,\033[0;90mnull\033' printf '[0m\033[1;37m\033[1;37' printf 'm]\033[0m\n' } > $d/expect cmp $d/color $d/expect ## Set non-default colors, complex input -JQ_COLORS='1;30:0;31:0;32:0;33:0;34:1;35:1;36:1;30' \ +JQ_COLORS='0;30:0;31:0;32:0;33:0;34:1;35:1;36:1;37' \ $JQ -Ccn '[{"a":true,"b":false},123,null]' > $d/color { printf '\033[1;35m[\033[1;36m{' - printf '\033[0m\033[1;30m"a"\033[' + printf '\033[0m\033[1;37m"a"\033[' printf '0m\033[1;36m:\033[0m\033[' printf '0;32mtrue\033[0m\033[1' - printf ';36m,\033[0m\033[1;30m' + printf ';36m,\033[0m\033[1;37m' printf '"b"\033[0m\033[1;36m:\033' printf '[0m\033[0;31mfalse\033' printf '[0m\033[1;36m\033[1;36' printf 'm}\033[0m\033[1;35m,\033[' printf '0;33m123\033[0m\033[1;' - printf '35m,\033[1;30mnull\033' + printf '35m,\033[0;30mnull\033' printf '[0m\033[1;35m\033[1;35' printf 'm]\033[0m\n' } > $d/expect @@ -503,16 +503,16 @@ if command -v script >/dev/null 2>&1; then fi faketty $JQ -n . > $d/color - printf '\033[1;30mnull\033[0m\r\n' > $d/expect + printf '\033[0;90mnull\033[0m\r\n' > $d/expect cmp $d/color $d/expect NO_COLOR= faketty $JQ -n . > $d/color - printf '\033[1;30mnull\033[0m\r\n' > $d/expect + printf '\033[0;90mnull\033[0m\r\n' > $d/expect cmp $d/color $d/expect NO_COLOR=1 faketty $JQ -n . > $d/color printf 'null\r\n' > $d/expect cmp $d/color $d/expect NO_COLOR=1 faketty $JQ -Cn . > $d/color - printf '\033[1;30mnull\033[0m\r\n' > $d/expect + printf '\033[0;90mnull\033[0m\r\n' > $d/expect cmp $d/color $d/expect fi |