]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0693: tests: Test_suspend() may fail because of keyprotocol query v9.2.0693
authorVladimír Marek <vlmarek13@gmail.com>
Sun, 21 Jun 2026 17:45:37 +0000 (17:45 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 21 Jun 2026 17:45:37 +0000 (17:45 +0000)
Problem:  tests: Test_suspend() may fail because of keyprotocol query
Solution: Disable keyprotocol and unset t_RK very early so that the
          inner Vim does not query it (Vladimír Marek)

The nested Vim can send a keyprotocol query during startup.  If the terminal
response arrives at the wrong time, the nested Vim may not consume it and the
response can be written to the inner terminal, leaving characters such as 4;2m
after the shell prompt when the test later suspends Vim.

The previous command tried to avoid that with -c 'set keyprotocol=', but -c
commands are applied too late.  Use --cmd 'set t_RK= keyprotocol=' so the
inner Vim disables the query before startup can send it.

closes: #20570

Signed-off-by: Vladimír Marek <vlmarek13@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/test_suspend.vim
src/version.c

index ae05dd21f29798093123e0b51c42bb8a101d4de1..69abeaed6e729ccc63b8db538835c73a1e78d36e 100644 (file)
@@ -30,7 +30,8 @@ func Test_suspend()
 
   call term_sendkeys(buf, v:progpath
         \               . " --clean -X"
-        \               . " -c 'set nu keyprotocol='"
+        \               . " --cmd 'set t_RK= keyprotocol='"
+        \               . " -c 'set nu'"
         \               . " -c 'call setline(1, \"foo\")'"
         \               . " Xfoo\<CR>")
   " Cursor in terminal buffer should be on first line in spawned vim.
@@ -80,7 +81,8 @@ func Test_suspend_autocmd()
 
   call term_sendkeys(buf, v:progpath
         \               . " --clean -X"
-        \               . " -c 'set nu keyprotocol='"
+        \               . " --cmd 'set t_RK= keyprotocol='"
+        \               . " -c 'set nu'"
         \               . " -c 'let g:count = 0'"
         \               . " -c 'au VimSuspend * let g:count += 1'"
         \               . " -c 'au VimResume * let g:count += 1'"
index 5b34e6a3d7becf15bb34c5ed4e6c65b71b353202..1bd3fd09bd558ec0563456d93a4117bf0e4322c0 100644 (file)
@@ -759,6 +759,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    693,
 /**/
     692,
 /**/