cmd: Set colour attributes when clearing the screen with 'cls'

Hugh McMaster hugh.mcmaster at outlook.com
Sun Nov 15 18:53:06 CST 2015


Fixes bug 37595 - https://bugs.winehq.org/show_bug.cgi?id=37595

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 programs/cmd/builtins.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index e9b9ddd..22f0580 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -236,13 +236,14 @@ void WCMD_clear_screen (void) {
   if (GetConsoleScreenBufferInfo(hStdOut, &consoleInfo))
   {
       COORD topLeft;
-      DWORD screenSize;
+      DWORD screenSize, written;
 
       screenSize = consoleInfo.dwSize.X * (consoleInfo.dwSize.Y + 1);
 
       topLeft.X = 0;
       topLeft.Y = 0;
-      FillConsoleOutputCharacterW(hStdOut, ' ', screenSize, topLeft, &screenSize);
+      FillConsoleOutputCharacterW(hStdOut, ' ', screenSize, topLeft, &written);
+      FillConsoleOutputAttribute(hStdOut, consoleInfo.wAttributes, screenSize, topLeft, &written);
       SetConsoleCursorPosition(hStdOut, topLeft);
   }
 }
-- 
1.9.1




More information about the wine-patches mailing list