mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
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.
This commit is contained in:
@@ -833,25 +833,22 @@ func Test_terminal_response_to_control_sequence()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let buf = Run_shell_in_terminal({})
|
let buf = Run_shell_in_terminal({})
|
||||||
call WaitFor({-> term_getline(buf, 1) != ""})
|
call WaitFor({-> term_getline(buf, 1) != ''})
|
||||||
|
|
||||||
call writefile(["\x1b[6n"], 'Xescape')
|
call term_sendkeys(buf, "cat\<CR>")
|
||||||
call term_sendkeys(buf, "cat Xescape\<cr>")
|
call WaitFor({-> term_getline(buf, 1) =~ 'cat'})
|
||||||
|
|
||||||
" wait for the response of control sequence from libvterm (and send it to tty)
|
" Request the cursor position.
|
||||||
sleep 200m
|
call term_sendkeys(buf, "\x1b[6n\<CR>")
|
||||||
call term_wait(buf)
|
|
||||||
|
|
||||||
" Wait for output from tty to display, below an empty line.
|
" Wait for output from tty to display, below an empty line.
|
||||||
" It should show \e3;1R, but only 1R may show up
|
call WaitFor({-> term_getline(buf, 4) =~ '3;1R'})
|
||||||
call assert_match('\<\d\+R', term_getline(buf, 3))
|
|
||||||
|
" End "cat" gently.
|
||||||
|
call term_sendkeys(buf, "\<CR>\<C-D>")
|
||||||
|
|
||||||
call term_sendkeys(buf, "\<c-c>")
|
|
||||||
call term_wait(buf)
|
|
||||||
call Stop_shell_in_terminal(buf)
|
call Stop_shell_in_terminal(buf)
|
||||||
|
|
||||||
exe buf . 'bwipe'
|
exe buf . 'bwipe'
|
||||||
call delete('Xescape')
|
|
||||||
unlet g:job
|
unlet g:job
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -766,6 +766,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1645,
|
||||||
/**/
|
/**/
|
||||||
1644,
|
1644,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user