comparison src/testdir/test_terminal.vim @ 12154:71e10b81226d v8.0.0957

patch 8.0.0957: a terminal job can deadlock when sending many keys commit https://github.com/vim/vim/commit/97bd5e6527bf2b48acdd1550acba161e82a5bc99 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 18 20:50:30 2017 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Fri, 18 Aug 2017 21:00:05 +0200
parents bb43ab26381e
children ee8ead988f2c
comparison
equal deleted inserted replaced
12153:7264e03147e1 12154:71e10b81226d
448 let buf = term_start([&shell, &shellcmdflag, 'echo "123"']) 448 let buf = term_start([&shell, &shellcmdflag, 'echo "123"'])
449 call assert_fails(buf . 'bwipe', 'E517') 449 call assert_fails(buf . 'bwipe', 'E517')
450 exe buf . 'bwipe!' 450 exe buf . 'bwipe!'
451 call assert_equal("", bufname(buf)) 451 call assert_equal("", bufname(buf))
452 endfunction 452 endfunction
453
454 func Test_terminal_noblock()
455 let buf = term_start(&shell)
456
457 for c in ['a','b','c','d','e','f','g','h','i','j','k']
458 call term_sendkeys(buf, 'echo ' . repeat(c, 5000) . "\<cr>")
459 endfor
460
461 let g:job = term_getjob(buf)
462 call Stop_shell_in_terminal(buf)
463 call term_wait(buf)
464 bwipe
465 endfunc