tldr-python-client icon indicating copy to clipboard operation
tldr-python-client copied to clipboard

Improved output handling on Windows

Open God-damnit-all opened this issue 3 years ago • 0 comments

Uses the Windows API to set the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for proper ANSI code handling, based off discussion from https://stackoverflow.com/questions/36760127

Also sets convert=True in the colorama initialization. This seems to improve compatibility when redirecting/piping output, particularly for line breaks.

(PowerShell 7+ Note: When piping the output of tldr.py, you should have $PSStyle.OutputRendering set to ANSI if you want colors to display.)

Fixes #178

God-damnit-all avatar May 29 '22 21:05 God-damnit-all