patch 9.2.0161: intro message disappears on startup in some terminals

Commit: 
https://github.com/vim/vim/commit/ef3d79ebbe014effa2acd15b26b42086f6c0eebf
Author: Foxe Chen <[email protected]>
Date:   Fri Mar 13 22:14:36 2026 +0000

    patch 9.2.0161: intro message disappears on startup in some terminals
    
    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 <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/term.c b/src/term.c
index a1bb6c1b9..a5fab44ea 100644
--- a/src/term.c
+++ b/src/term.c
@@ -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
 
diff --git a/src/testdir/test_termcodes.vim b/src/testdir/test_termcodes.vim
index e5f31259e..90cbc87df 100644
--- a/src/testdir/test_termcodes.vim
+++ b/src/testdir/test_termcodes.vim
@@ -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)
diff --git a/src/version.c b/src/version.c
index c0f5c7488..c215222c9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    161,
 /**/
     160,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1w1B19-00429U-9W%40256bit.org.

Raspunde prin e-mail lui