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
doctest’s check for whether to enable color output is too simplistic: it just tests isatty(STDOUT_FILENO) (e.g. in the color_to_stream function.) But not all TTYs support ANSI color; one common exception is Xcode’s console pane.
This causes junk to appear in the output for just about anyone developing native Mac or iOS apps unless they disable color on the command line.
Steps to reproduce
Run doctest tests in an Xcode project, with output going to the console pane as usual.
Expected: Plain output
Actual: Lots of “[0;36m and the like in the console output
Extra information
On Unix systems you can test the TERM environment variable, but that doesn’t work on Windows. Here’s a reliable function that I’ve used in other projects:
Description
doctest’s check for whether to enable color output is too simplistic: it just tests
isatty(STDOUT_FILENO)
(e.g. in thecolor_to_stream
function.) But not all TTYs support ANSI color; one common exception is Xcode’s console pane.This causes junk to appear in the output for just about anyone developing native Mac or iOS apps unless they disable color on the command line.
Steps to reproduce
Run doctest tests in an Xcode project, with output going to the console pane as usual.
[0;36m
and the like in the console outputExtra information
On Unix systems you can test the
TERM
environment variable, but that doesn’t work on Windows. Here’s a reliable function that I’ve used in other projects:The text was updated successfully, but these errors were encountered: