Closed timotheecour closed 1 week ago
What is the less
command line option for it to force color when redirecting output?
I find that unexpected for a pager, especially less
which doesn't do any coloring that I'm aware of, so a concrete example would be super!
@timotheecour if you still want this, feel free to re-open with more info!
in most programs (eg rg, yq, less etc), there's an option to write colors even if output is redirected (to stdout or a file etc). Can we either honor the flag
--colors=8
when specified, or add a flag--usecolors=yes|no|auto
to specify whether coloring should be used (yes would force regardless of stdout redirection, auto would depend on whether stdout is redirected)I use moar because it just works for syntax highlight (eg use case where other tools fail: https://github.com/mikefarah/yq/issues/1162#issuecomment-2086923873) but now am facing the issue that it doesn't work if I need to redirect it somehow