PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, December 14, 2022

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

 December 14, 2022     jq, json, syntax, text-coloring     No comments   

Issue

How do I specify colors other than the defaults used for jq --color-output?


Solution

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:

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:

- 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".

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:

- 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)


Answered By - peak
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing