You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pygmentize wraps stdout with colorama on Windows. This ensures correct color output on the console but when output is redirected to a pipe it strips the ansi sequences by default. This prevents me from piping the output to less or other tools. On the modern windows terminal ansi escapes are handled directly by the terminal anyway so colorama is not necessary, and even on older windows tools like Cygwin's less/cat handle ansi sequences internally so being able to pipe them is still useful.
The fix I think is either setting strip=False in colorama.initialise.wrap_stream() so it won't touch non-console output, or (for the most recent colorama version) calling colorama.just_fix_windows_console instead (see tartley/colorama#139 (comment))
The text was updated successfully, but these errors were encountered:
Pygmentize wraps stdout with colorama on Windows. This ensures correct color output on the console but when output is redirected to a pipe it strips the ansi sequences by default. This prevents me from piping the output to
less
or other tools. On the modern windows terminal ansi escapes are handled directly by the terminal anyway so colorama is not necessary, and even on older windows tools like Cygwin's less/cat handle ansi sequences internally so being able to pipe them is still useful.The fix I think is either setting
strip=False
in colorama.initialise.wrap_stream() so it won't touch non-console output, or (for the most recent colorama version) callingcolorama.just_fix_windows_console
instead (see tartley/colorama#139 (comment))The text was updated successfully, but these errors were encountered: