简体   繁体   English

如何自定义'jq -C'使用的颜色?

[英]How do I customize the colors used by 'jq -C'?

如何指定jq --color-output使用的默认颜色以外的其他颜色?

Support for the JQ_COLORS environment variable was added to the development version on April 29, 2017 (that is, after the release of jq 1.5), with the following documentation: 对JQ_COLORS环境变量的支持已在2017年4月29日(即 jq 1.5发行之后 )添加到开发版本中,其中包含以下文档:

To configure alternative colors just set the JQ_COLORS environment variable to colon-delimited list of partial terminal escape sequences like "1;31" , in this order: 要配置其他颜色,只需将JQ_COLORS环境变量设置为部分终端转义序列的冒号分隔列表,例如"1;31" ,顺序如下:

- color for `null`
- color for `false`
- color for `true`
- color for numbers
- color for strings
- color for arrays
- color for objects

The default color scheme is the same as setting "JQ_COLORS=1;30:0;39:0;39:0;39:0;32:1;39:1;39" . 默认配色方案与设置"JQ_COLORS=1;30:0;39:0;39:0;39:0;32:1;39:1;39"

This is not a manual for VT100/ANSI escapes. 这不是VT100 / ANSI转义的手册。 However, each of these color specifications should consist of two numbers separated by a semi-colon, where the first number is one of these: 但是,这些颜色规范中的每一个都应由两个数字组成,并用分号分隔,其中第一个数字是其中一个:

- 1 (bright)
- 2 (dim)
- 4 (underscore)
- 5 (blink)
- 7 (reverse)
- 8 (hidden)

and the second is one of these: 第二个是其中之一:

- 30 (black)
- 31 (red)
- 32 (green)
- 33 (yellow)
- 34 (blue)
- 35 (magenta)
- 36 (cyan)
- 37 (white)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM