tldr-pages / tldr-c-client

C command-line client for tldr pages
MIT License
296 stars 49 forks source link

disable colors #35

Closed t184256 closed 10 months ago

t184256 commented 6 years ago

Please add an option to disable color highlighting (or specify a configurable colorscheme).

xuchunyang commented 5 years ago

The color should be disabled automatically when the output is not terminal, for example, the color becomes annoying in the following uses:

tldr ls | less
tldr ls > ls.md

Some programs, such as ls and grep, provides --color=auto|never|always.

t184256 commented 5 years ago

Yes. And I want such an option for tldr.

CleanMachine1 commented 2 years ago

For anyone needing a quick and annoying method, change the ANSI codes being used here (and onwards) https://github.com/tldr-pages/tldr-c-client/blob/be56821515b6d35e6bd25845108a23215c0d447e/src/tldr.h#L44 to other ANSI codes such as \033[37m to make it white for example

Don't forget to recompile

CleanMachine1 commented 2 years ago

We could just make read whether there is other defined ANSI codes, if not just default to these ones.