Skip to content

Commit 43f577c

Browse files
author
Andreas Ringlstetter
committed
Missing isatty check for WIndows
1 parent abad39e commit 43f577c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/catch2/internal/catch_istream.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,11 @@ namespace Detail {
131131
ErrnoGuard _; // for isatty
132132
m_isatty = m_isatty && isatty( STDOUT_FILENO );
133133
#elif defined( CATCH_PLATFORM_WINDOWS )
134+
m_isatty = m_isatty && _isatty( _fileno( stdout ) );
134135
m_isatty = m_isatty && enableVirtualTerminalSupport( STD_OUTPUT_HANDLE );
135136
#endif
136137
#if defined( CATCH_PLATFORM_MAC ) || defined( CATCH_PLATFORM_IPHONE )
137-
m_isatty = m_isatty && !isDebuggerActive();
138+
m_isatty = m_isatty && !isDebuggerActive();
138139
#endif
139140
}
140141

@@ -156,6 +157,7 @@ namespace Detail {
156157
ErrnoGuard _; // for isatty
157158
m_isatty = m_isatty && isatty( STDERR_FILENO );
158159
#elif defined( CATCH_PLATFORM_WINDOWS )
160+
m_isatty = m_isatty && _isatty( _fileno( stderr ) );
159161
m_isatty = m_isatty && enableVirtualTerminalSupport( STD_ERROR_HANDLE );
160162
#endif
161163
#if defined( CATCH_PLATFORM_MAC ) || defined( CATCH_PLATFORM_IPHONE )

0 commit comments

Comments
 (0)