]> granicus.if.org Git - vim/commitdiff
patch 8.2.4031: crash in xterm with only two lines v8.2.4031
authorBram Moolenaar <Bram@vim.org>
Fri, 7 Jan 2022 19:24:20 +0000 (19:24 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 7 Jan 2022 19:24:20 +0000 (19:24 +0000)
Problem:    Crash in xterm with only two lines. (Dominique PellĂ©)
Solution:   Only perform xterm compatibility test if possible. (closes #9488)

src/term.c
src/testdir/test_startup.vim
src/version.c

index 85f6229342522504e70d3f3a167cf843abbbbbfa..853d93fefa5d0330657e17e62f79d19dcb69fe90 100644 (file)
@@ -3801,7 +3801,7 @@ check_terminal_behavior(void)
        line_was_clobbered(1);
     }
 
-    if (xcc_status.tr_progress == STATUS_GET)
+    if (xcc_status.tr_progress == STATUS_GET && Rows > 2)
     {
        // 2. Check compatibility with xterm.
        // We move the cursor to (2, 0), print a test sequence and then query
index d67bfb7777a82f9234b2508819bbed03a1a66c8b..1c1e1c0f3f0ddc22a69cb64568e3cf26d6a0a458 100644 (file)
@@ -821,6 +821,17 @@ func Test_start_with_tabs()
   call StopVimInTerminal(buf)
 endfunc
 
+func Test_start_in_minimal_window()
+  CheckRunVimInTerminal
+
+  let buf = RunVimInTerminal('-c "set nomore"', {'cols': 12, 'rows': 2, 'keep_t_u7': 1})
+  call term_sendkeys(buf, "ahello\<Esc>")
+  call WaitForAssert({-> assert_match('^hello', term_getline(buf, 1))})
+
+  " clean up
+  call StopVimInTerminal(buf)
+endfunc
+
 func Test_v_argv()
   " Can't catch the output of gvim.
   CheckNotGui
index 5658467464584935d39d2fbf8e0e86e1a62a1c1b..cc9d81ea2b2325d531189864e3c8647b359b14eb 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4031,
 /**/
     4030,
 /**/