Removing colour from the colourless
Considerate use of colour can help paint a picture on the command line, but when a tool doesn't support the requisite ANSI codes output becomes garbled beyond recognition.
Well behaved tools sometimes support switches and environment variables to both turn on and off colorised output.
git --no-color log
GIT_CONFIG_PARAMETERS="'color.ui=never'" git log
rg --color=never
NO_COLOR=true rg
Unfortunately, something like nix flake metadata
insists on colorising output
and provides no way to prevent this, which makes for lousy output when
evaluating source blocks with Org mode.
As a last resort, one can substitute out the escape codes using sed
:
nix flake metadata | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g"