patch 9.1.1208: MS-Windows: not correctly restoring alternate screen on Win 10
Problem: MS-Windows: not correctly restoring alternate screen on Win 10
after ssh (Daniel Viberg)
Solution: return a bit later in RestoreConsoleBuffer()
(Christopher Plewright)
fixes: #16418
closes: #16897
Signed-off-by: Christopher Plewright <chris@createng.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/os_win32.c b/src/os_win32.c
index eedd0a5..0ba4eed 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -3284,10 +3284,6 @@
SMALL_RECT WriteRegion;
int i;
- // VTP uses alternate screen buffer.
- // No need to restore buffer contents.
- if (use_alternate_screen_buffer)
- return TRUE;
if (cb == NULL || !cb->IsValid)
return FALSE;
@@ -3319,6 +3315,11 @@
if (!SetConsoleWindowInfo(g_hConOut, TRUE, &cb->Info.srWindow))
return FALSE;
+ // VTP uses alternate screen buffer.
+ // No need to restore buffer contents.
+ if (use_alternate_screen_buffer)
+ return TRUE;
+
/*
* Restore the screen buffer contents.
*/