patch 8.2.0662: cannot use input() in a channel callback
Problem: Cannot use input() in a channel callback.
Solution: Reset vgetc_busy. (closes #6010)
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index 4a438ea..019b959 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -6,6 +6,7 @@
source shared.vim
source screendump.vim
+source view_util.vim
let s:python = PythonProg()
if s:python == ''
@@ -2297,4 +2298,20 @@
%bw!
endfunc
+func ExitCb_cb_with_input(job, status)
+ call feedkeys(":\<C-u>echo input('', 'default')\<CR>\<CR>", 'nx')
+ call assert_equal('default', Screenline(&lines))
+ let g:wait_exit_cb = 0
+endfunc
+
+func Test_cb_with_input()
+ let g:wait_exit_cb = 1
+
+ call job_start('echo "Vim''s test"',
+ \ {'out_cb': 'ExitCb_cb_with_input'})
+ call WaitForAssert({-> assert_equal(0, g:wait_exit_cb)})
+
+ unlet g:wait_exit_cb
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab