moar icon indicating copy to clipboard operation
moar copied to clipboard

`moar --colors=8 > output.txt` doesn't write colors

Open timotheecour opened this issue 2 months ago • 1 comments

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

timotheecour avatar Apr 30 '24 20:04 timotheecour