summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-08-18 20:50:30 +0200
committerBram Moolenaar <Bram@vim.org>2017-08-18 20:50:30 +0200
commit97bd5e6527bf2b48acdd1550acba161e82a5bc99 (patch)
tree22b6437023669cf07961a5ac29490ea8d33e9340 /src/testdir
parentcfce71710b6a2e1fb7f7f27d2a359e4b926f3af9 (diff)
downloadvim-97bd5e6527bf2b48acdd1550acba161e82a5bc99.zip
patch 8.0.0957: a terminal job can deadlock when sending many keys
Problem: When term_sendkeys() sends many keys it may get stuck in writing to the job. Solution: Make the write non-blocking, buffer keys to be sent.
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_terminal.vim13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index fe3d7df67..c75d07f2b 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -450,3 +450,16 @@ func Test_terminal_list_args()
exe buf . 'bwipe!'
call assert_equal("", bufname(buf))
endfunction
+
+func Test_terminal_noblock()
+ let buf = term_start(&shell)
+
+ for c in ['a','b','c','d','e','f','g','h','i','j','k']
+ call term_sendkeys(buf, 'echo ' . repeat(c, 5000) . "\<cr>")
+ endfor
+
+ let g:job = term_getjob(buf)
+ call Stop_shell_in_terminal(buf)
+ call term_wait(buf)
+ bwipe
+endfunc