Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
timotheecour opened this issue Apr 30, 2024 · 1 comment
Open

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

timotheecour opened this issue Apr 30, 2024 · 1 comment

Comments

@timotheecour
Copy link

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: mikefarah/yq#1162 (comment)) but now am facing the issue that it doesn't work if I need to redirect it somehow

@walles
Copy link
Owner

walles commented May 1, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants