Module: wine Branch: master Commit: 8993f5720a453aecb9ead2cd7531f6513340de97 URL: https://gitlab.winehq.org/wine/wine/-/commit/8993f5720a453aecb9ead2cd7531f65...
Author: Eric Pouech eric.pouech@gmail.com Date: Wed Jan 11 10:34:03 2023 +0100
conhost: Reset console attribute upon exit in unix mode.
Signed-off-by: Eric Pouech eric.pouech@gmail.com
---
programs/conhost/conhost.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index 769f998f404..bf46e6b1c18 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -2859,9 +2859,18 @@ static int main_loop( struct console *console, HANDLE signal ) return 0; }
+static void teardown( struct console *console ) +{ + if (console->is_unix) + { + set_tty_attr( console, empty_char_info.attr ); + tty_flush( console ); + } +} + int __cdecl wmain(int argc, WCHAR *argv[]) { - int headless = 0, i, width = 0, height = 0; + int headless = 0, i, width = 0, height = 0, ret; HANDLE signal = NULL; WCHAR *end;
@@ -2954,5 +2963,8 @@ int __cdecl wmain(int argc, WCHAR *argv[]) ShowWindow( console.win, (si.dwFlags & STARTF_USESHOWWINDOW) ? si.wShowWindow : SW_SHOW ); }
- return main_loop( &console, signal ); + ret = main_loop( &console, signal ); + teardown( &console ); + + return ret; }