From 17d4c0e0f992c35443b7af8fdb31ea678d0831ee Mon Sep 17 00:00:00 2001 From: Mineplay Date: Sat, 18 Oct 2025 09:46:24 -0500 Subject: [PATCH] fix(console coloring): fixed enter for windows get character function --- Src/Core/Console.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Src/Core/Console.c b/Src/Core/Console.c index a33568d..89ff4b4 100644 --- a/Src/Core/Console.c +++ b/Src/Core/Console.c @@ -128,6 +128,12 @@ IonyError iony_console_get_character(char *character) { if (!ReadFile(iony_standard_console_in, character, 1, &characters_read, 0)) { return IONY_ERROR_SYSTEM_CALL_FAILED; } + + if (character == '\r') { + if (!ReadFile(iony_standard_console_in, character, 1, &characters_read, 0)) { + return IONY_ERROR_SYSTEM_CALL_FAILED; + } + } #elif defined(__GNUC__) if (iony_system_call(IONY_SYS_READ, 0, (long)character, 1, 0, 0, 0) < 0) { return IONY_ERROR_SYSTEM_CALL_FAILED; @@ -174,7 +180,6 @@ IonyError iony_console_set_color(IonyConsoleColor color) { } } - DWORD characters_written; if (SetConsoleTextAttribute(iony_standard_console_out, color) == 0) { return IONY_ERROR_SYSTEM_CALL_FAILED; }