patch 8.1.0938: background color is wrong in MS-Windows console
Problem: Background color is wrong in MS-Windows console when not using VTP.
Solution: Use g_attrCurrent. (Nobuhiro Takasaki, closes #3987)
diff --git a/src/os_win32.c b/src/os_win32.c
index 3627532..97fc2a4 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -6031,7 +6031,10 @@
{
fill.Char.AsciiChar = ' ';
- fill.Attributes = g_attrDefault;
+ if (!USE_VTP)
+ fill.Attributes = g_attrCurrent;
+ else
+ fill.Attributes = g_attrDefault;
set_console_color_rgb();
@@ -6085,7 +6088,10 @@
{
fill.Char.AsciiChar = ' ';
- fill.Attributes = g_attrDefault;
+ if (!USE_VTP)
+ fill.Attributes = g_attrCurrent;
+ else
+ fill.Attributes = g_attrDefault;
set_console_color_rgb();