]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0161: intro message disappears on startup in some terminals v9.2.0161
authorFoxe Chen <chen.foxe@gmail.com>
Fri, 13 Mar 2026 22:14:36 +0000 (22:14 +0000)
committerChristian Brabandt <cb@256bit.org>
Fri, 13 Mar 2026 22:14:36 +0000 (22:14 +0000)
Problem:  intro message disappears on startup in some terminals
          (chdiza, after v9.2.0139)
Solution: Only call set_shellsize() in handle_csi() if the reported
          width or height actually differs from the current
          Rows or Columns. (Foxe Chen)

fixes:  #19656
closes: #19660

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/term.c
src/testdir/test_termcodes.vim
src/version.c

index a1bb6c1b97d4948c6faa12599d8faeadd91f9b69..a5fab44ea8cf782d319cda466c2fbe86f61bea56 100644 (file)
@@ -5791,7 +5791,10 @@ handle_csi(
        key_name[0] = (int)KS_EXTRA;
        key_name[1] = (int)KE_IGNORE;
 
-       set_shellsize(width, height, true);
+       // Only update if needed. Avoids intro message from disappearing on
+       // startup (due to initial event).
+       if (height != Rows || width != Columns)
+           set_shellsize(width, height, true);
     }
 #endif
 
index e5f31259e516acd4087fba12b7b2ffe097a6ed86..90cbc87df956cd7d50917185a2fce450bee19464 100644 (file)
@@ -2991,6 +2991,16 @@ func Test_term_win_resize()
 
   call WaitForAssert({-> assert_equal(["50 100"], readfile("XTestWinResizeResult"))})
 
+  " Test that screen is only resized if it actually changed in width or height.
+  call term_sendkeys(buf, "\<Esc>:intro\<CR>")
+  call TermWait(buf)
+
+  call term_sendkeys(buf, "\<Esc>[48;50;100;0;0t")
+  call TermWait(buf)
+
+  " call delete("tmp.dump")
+  " call term_dumpwrite(buf, "tmp.dump")
+
   " SIGWINCH handler should be uninstalled
   call job_stop(term_getjob(buf), 28)
   call TermWait(buf)
index c0f5c7488a6d43021a6bde3f80e742177e5d960b..c215222c906b91f72cd33d47c19d097ee42b1af4 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    161,
 /**/
     160,
 /**/