From cf7dbd478aac33f23d752b9075cb9e0f6eb35885 Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Thu, 14 Dec 2017 12:45:35 +0100 Subject: [PATCH] Made prompt respect color reset --- library/Console-windows.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/Console-windows.cpp b/library/Console-windows.cpp index 28d98309b..99f7ace39 100644 --- a/library/Console-windows.cpp +++ b/library/Console-windows.cpp @@ -214,8 +214,11 @@ namespace DFHack { COORD pos = { (SHORT)x, (SHORT)y }; DWORD count = 0; - WriteConsoleOutputCharacterA(console_out, str, len, pos, &count); - } + CONSOLE_SCREEN_BUFFER_INFO inf = { 0 }; + GetConsoleScreenBufferInfo(console_out, &inf); + SetConsoleCursorPosition(console_out, pos); + WriteConsoleA(console_out, str, len, &count, NULL); + } void prompt_refresh() {