Mercurial > vim
changeset 35924:18f48c616273 v9.1.0664
patch 9.1.0664: MS-Windows: console vim did not switch back to main screen on exit
Commit: https://github.com/vim/vim/commit/568cbc92a6637ef9272490fb0361adb73f158cfc
Author: Ken Takata <kentkt@csc.jp>
Date: Wed Aug 7 21:18:24 2024 +0200
patch 9.1.0664: MS-Windows: console vim did not switch back to main screen on exit
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>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 07 Aug 2024 21:30:07 +0200 |
parents | c372fb4d0f49 |
children | ad1859901f3a |
files | src/os_win32.c src/version.c |
diffstat | 2 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/os_win32.c +++ b/src/os_win32.c @@ -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)) { /*