Skip to content

Commit 086eb87

Browse files
committed
patch 8.0.1645: test for terminal response to escape sequence may fail
Problem: Test for terminal response to escape sequence fails for some people. (toothpik) Solution: Run "cat" and let it echo the characters.
1 parent cf67a50 commit 086eb87

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

Diff for: src/testdir/test_terminal.vim

+9-12
Original file line numberDiff line numberDiff line change
@@ -833,25 +833,22 @@ func Test_terminal_response_to_control_sequence()
833833
endif
834834

835835
let buf = Run_shell_in_terminal({})
836-
call WaitFor({-> term_getline(buf, 1) != ""})
836+
call WaitFor({-> term_getline(buf, 1) != ''})
837837

838-
call writefile(["\x1b[6n"], 'Xescape')
839-
call term_sendkeys(buf, "cat Xescape\<cr>")
838+
call term_sendkeys(buf, "cat\<CR>")
839+
call WaitFor({-> term_getline(buf, 1) =~ 'cat'})
840840

841-
" wait for the response of control sequence from libvterm (and send it to tty)
842-
sleep 200m
843-
call term_wait(buf)
841+
" Request the cursor position.
842+
call term_sendkeys(buf, "\x1b[6n\<CR>")
844843

845844
" Wait for output from tty to display, below an empty line.
846-
" It should show \e3;1R, but only 1R may show up
847-
call assert_match('\<\d\+R', term_getline(buf, 3))
845+
call WaitFor({-> term_getline(buf, 4) =~ '3;1R'})
848846

849-
call term_sendkeys(buf, "\<c-c>")
850-
call term_wait(buf)
851-
call Stop_shell_in_terminal(buf)
847+
" End "cat" gently.
848+
call term_sendkeys(buf, "\<CR>\<C-D>")
852849

850+
call Stop_shell_in_terminal(buf)
853851
exe buf . 'bwipe'
854-
call delete('Xescape')
855852
unlet g:job
856853
endfunc
857854

Diff for: src/version.c

+2
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,8 @@ static char *(features[]) =
766766

767767
static int included_patches[] =
768768
{ /* Add new patch number below this line */
769+
/**/
770+
1645,
769771
/**/
770772
1644,
771773
/**/

0 commit comments

Comments
 (0)