]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0664: MS-Windows: console vim did not switch back to main screen on exit v9.1.0664
authorKen Takata <kentkt@csc.jp>
Wed, 7 Aug 2024 19:18:24 +0000 (21:18 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 7 Aug 2024 19:18:24 +0000 (21:18 +0200)
Problem:  MS-Windows: console vim did not switch back to main screen on
          exit
Solution: switch back to main screen on exit (Ken Takata)

`vim.exe --cmd quit` quitted without switching back to the main screen
buffer and the alternate screen buffer was kept shown.

Restore the main screen buffer even when termcap mode has not been
started.

closes: #15443

Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/os_win32.c
src/version.c

index 44d92c0f4ab98d2428a63130400382b4b3c55d2b..6384ac87360ba0f2f41c17fc910c2ff3975bba44 100644 (file)
@@ -3561,6 +3561,10 @@ mch_exit_c(int r)
     vtp_exit();
 
     stoptermcap();
+    // Switch back to main screen buffer.
+    if (use_alternate_screen_buffer)
+       vtp_printf("\033[?1049l");
+
     if (g_fWindInitCalled)
        settmode(TMODE_COOK);
 
@@ -6334,10 +6338,6 @@ termcap_mode_end(void)
     RestoreConsoleBuffer(cb, p_rs);
     restore_console_color_rgb();
 
-    // Switch back to main screen buffer.
-    if (exiting && use_alternate_screen_buffer)
-       vtp_printf("\033[?1049l");
-
     if (!USE_WT && (p_rs || exiting))
     {
        /*
index c4ade6f4f613d87c46f5cfbaa439bced6092402c..ce5894f89aff5960673af85fe913202d1bce6297 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    664,
 /**/
     663,
 /**/