From 2a0d6aeb15d06e01ecc1347a291b0c9abc70a5b9 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Mon, 21 Sep 2015 15:50:40 -0400 Subject: [PATCH] fix clear bug on windows (thanks jared) --- terminal.d | 2 ++ 1 file changed, 2 insertions(+) diff --git a/terminal.d b/terminal.d index 741ca02..a3c95d1 100644 --- a/terminal.d +++ b/terminal.d @@ -1106,11 +1106,13 @@ http://msdn.microsoft.com/en-us/library/windows/desktop/ms683193%28v=vs.85%29.as doTermcap("cl"); } else version(Windows) { // http://support.microsoft.com/kb/99261 + flush(); DWORD c; CONSOLE_SCREEN_BUFFER_INFO csbi; DWORD conSize; GetConsoleScreenBufferInfo(hConsole, &csbi); + conSize = csbi.dwSize.X * csbi.dwSize.Y; COORD coordScreen; FillConsoleOutputCharacterA(hConsole, ' ', conSize, coordScreen, &c); FillConsoleOutputAttribute(hConsole, csbi.wAttributes, conSize, coordScreen, &c);