From 81dcace4f10feabbc9722e2531b834a6651152d3 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 10 Aug 2024 13:15:05 +0100 Subject: [PATCH] Windows: assign the right handle into conio->hout. Thanks to Will Bond for spotting this. Using STD_INPUT_HANDLE as an output handle apparently works often enough that I didn't immediately notice the mistake, but it's not what I _meant_ to do. Obviously we should have used STD_OUTPUT_HANDLE instead. --- windows/console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/console.c b/windows/console.c index 6db3dd14..89021a9f 100644 --- a/windows/console.c +++ b/windows/console.c @@ -119,7 +119,7 @@ static ConsoleIO *conio_setup(bool utf8) if (conio->hin == INVALID_HANDLE_VALUE) conio->hin = GetStdHandle(STD_INPUT_HANDLE); if (conio->hout == INVALID_HANDLE_VALUE) - conio->hout = GetStdHandle(STD_INPUT_HANDLE); + conio->hout = GetStdHandle(STD_OUTPUT_HANDLE); DWORD dummy; conio->hin_is_console = GetConsoleMode(conio->hin, &dummy);