colored-rs / colored

(Rust) Coloring terminal so simple you already know how to do it !

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No colors with less -r

pronebird opened this issue · comments

Does not seem to produce colored output when using with | less -r or | grep. Not sure what changed. Used cli_tables before and everything seemed to work fine.

Hey! I'm a new contributor to this project, but I'll be helping to keep things going forward for the crate.

I'm pretty sure this is due to here:

&& atty::is(atty::Stream::Stdout),

Which disables coloring when you're not using a TTY (which I'm pretty sure is the case when you're piping out to another program). I'm still figuring out if this is supposed to be intended behavior, but I'll let you know once I figured out otherwise. In the meantime you can still set the CLICOLOR_FORCE variable to force color to be enabled though.