diff src/testdir/test_terminal.vim @ 13132:fe0cec169589 v8.0.1440

patch 8.0.1440: terminal window: some vterm responses are delayed commit https://github.com/vim/vim/commit/b50773c6df0bc2c9c2ab1afecc78083abc606de0 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 30 22:31:19 2018 +0100 patch 8.0.1440: terminal window: some vterm responses are delayed Problem: Terminal window: some vterm responses are delayed. Solution: After writing input. check if there is output to read. (Ozaki Kiichi, closes #2594)
author Christian Brabandt <cb@256bit.org>
date Tue, 30 Jan 2018 22:45:05 +0100
parents fb1b162cdcf6
children 36c503100cb3
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -806,3 +806,26 @@ func Test_terminal_term_start_empty_comm
   let cmd = "call term_start(0, {'curwin' : 1, 'term_finish' : 'close'})"
   call assert_fails(cmd, 'E474')
 endfunc
+
+func Test_terminal_response_to_control_sequence()
+  if !has('unix')
+    return
+  endif
+
+  let buf = Run_shell_in_terminal({})
+  call term_wait(buf)
+
+  call term_sendkeys(buf, s:python . " -c 'import sys;sys.stdout.write(\"\\x1b[6n\")'\<cr>")
+  " wait for the response of control sequence from libvterm (and send it to tty)
+  call term_wait(buf, 100)
+  " wait for output from tty to display
+  call term_wait(buf)
+  call assert_match(';\d\+R', term_getline(buf, 2))
+
+  call term_sendkeys(buf, "\<c-c>")
+  call term_wait(buf)
+  call Stop_shell_in_terminal(buf)
+
+  exe buf . 'bwipe'
+  unlet g:job
+endfunc