tldr-pages / tldr-python-client

:snake: Python command-line client for tldr pages 📚
https://pypi.org/project/tldr/
MIT License
599 stars 95 forks source link

Don't drop color when piping #59

Closed CosmicToast closed 6 years ago

CosmicToast commented 6 years ago

Colorama (by default, appears to be) dropping colors whenever the content is piped (e.g into a pager, as in tldr tar | less -R).

However, if initialized with strip=False, it doesn't do that.

I don't expect tldr to be used to pipe into a file or anything of the sort, while people piping (especially multiple tldrs!) into a pager will likely want their colors.

to reproduce:

  1. install tldr-python-client
  2. run tldr tar | less -R

expected behavior: less shows colors

actual behavior: all ansi escape sequences have been stripped