@@ -833,25 +833,22 @@ func Test_terminal_response_to_control_sequence()
833
833
endif
834
834
835
835
let buf = Run_shell_in_terminal ({})
836
- call WaitFor ({- > term_getline (buf , 1 ) != " " })
836
+ call WaitFor ({- > term_getline (buf , 1 ) != ' ' })
837
837
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 ' } )
840
840
841
- " wait for the response of control sequence from libvterm (and send it to tty)
842
- sleep 200 m
843
- call term_wait (buf )
841
+ " Request the cursor position.
842
+ call term_sendkeys (buf , " \x1b [6n\<CR> " )
844
843
845
844
" 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' })
848
846
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> " )
852
849
850
+ call Stop_shell_in_terminal (buf )
853
851
exe buf . ' bwipe'
854
- call delete (' Xescape' )
855
852
unlet g: job
856
853
endfunc
857
854
0 commit comments