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
The function ColorPrintf() ass-u-mes that all users of this library have terminals with a black background colour.
I.e. using it in Microsoft's STL library and the benchmark-std_copy.exe program, the output like like this:
Not very nice IMHO.
With my blue terminal background I'd like it to look like:
which I fixed with:
--- a/src/colorprint.cc 2022-09-10 14:58:12+++ b/src/colorprint.cc 2022-09-10 14:54:32@@ -136,13 +136,16 @@
CONSOLE_SCREEN_BUFFER_INFO buffer_info;
GetConsoleScreenBufferInfo(stdout_handle, &buffer_info);
const WORD old_color_attrs = buffer_info.wAttributes;
+ WORD new_attr;
// We need to flush the stream buffers into the console before each
// SetConsoleTextAttribute call lest it affect the text that is already
// printed but has not yet reached the console.
fflush(stdout);
+ new_attr = (buffer_info.wAttributes & ~7);+ new_attr &= ~8; // Since 'wAttributes' could have been hi-intensity at startup.
SetConsoleTextAttribute(stdout_handle,
- GetPlatformColorCode(color) | FOREGROUND_INTENSITY);+ new_attr | GetPlatformColorCode(color) | FOREGROUND_INTENSITY);
vprintf(fmt, args);
fflush(stdout);
Hello folks, my first issue.
The function
ColorPrintf()
ass-u-mes that all users of this library have terminals with a black background colour.I.e. using it in Microsoft's STL library and the
benchmark-std_copy.exe
program, the output like like this:Not very nice IMHO.
With my blue terminal background I'd like it to look like:
which I fixed with:
PS. I use JPsoft's 4NT as the shell.
System
The text was updated successfully, but these errors were encountered: