docs/src/output-colorization.md
As of version 6.0.0, Miller supports output colorization. This includes colors per se, as well as bold, underline, and/or reverse. As of version 6.1.0, the default is bold+underline for keys -- this works well as a default regardless of your terminal's color settings -- with further customization options as described below:
By default, colorize output only if writing to stdout and stdout is a TTY.
mlr --csv cat foo.csvmlr --csv cat foo.csv > bar.csvmlr --csv cat foo.csv | lessNIDX output format (plain text, Unix-style, with implicitly positionally indexed fields) is not colored. This is because in other formats, keys are one color and values are another. For NIDX, all output is values.
Suppression/unsuppression:
export MLR_NO_COLOR=true or export NO_COLOR=true means Miller won't color even when it normally would.export MLR_ALWAYS_COLOR=true means Miller will color even when it normally would not. For example, you might want to use this when piping mlr output to less -r.--no-color or -M, --always-color or -C.export with setColor choices can be specified by using environment variables or command-line flags, with values 0..255:
export MLR_KEY_COLOR=208export MLR_VALUE_COLOR=33export with setMLR_PASS_COLOR, MLR_FAIL_COLOR, MLR_HELP_COLOR, MLR_REPL_PS1_COLOR, and MLR_REPL_PS2_COLOR.--key-color 208, --value-color 33, etc., and likewise for --pass-color, --fail-color, --repl-ps1-color, --repl-ps2-color, and --help-color.If environment-variable settings and command-line flags are both provided, the latter take precedence.
Use mlr --list-color-names to see available names, like orchid. Colors can also be specified
using numbers in the range 0..255, like 170: please see mlr --list-color-codes. You can also use
bold, underline, and/or reverse. Additionally, combinations of all of these can be joined
with a -, like red-bold, bold-170, bold-underline, etc.