patch 8.1.1300: in a terminal 'ballooneval' does not work right away

Problem:    In a terminal 'ballooneval' does not work right away.
Solution:   Flush output after drawing the balloon.  Add the <Ignore> key
            code.  Add a test.
diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak
index 2bda742..6b966e6 100644
--- a/src/testdir/Make_all.mak
+++ b/src/testdir/Make_all.mak
@@ -68,6 +68,7 @@
 	test_autoload \
 	test_backspace_opt \
 	test_backup \
+	test_balloon \
 	test_behave \
 	test_blob \
 	test_blockedit \
@@ -294,6 +295,7 @@
 	test_autocmd.res \
 	test_autoload.res \
 	test_backspace_opt.res \
+	test_balloon.res \
 	test_blob.res \
 	test_blockedit.res \
 	test_breakindent.res \
diff --git a/src/testdir/dumps/Test_balloon_eval_term_01.dump b/src/testdir/dumps/Test_balloon_eval_term_01.dump
new file mode 100644
index 0000000..20a7197
--- /dev/null
+++ b/src/testdir/dumps/Test_balloon_eval_term_01.dump
@@ -0,0 +1,10 @@
+>o+0&#ffffff0|n|e| |o|n|e| |o|n|e| @38
+@2|o| |t|X|o| |t|w|o| @38
+|t|h|r|e| +0#0000001#ffd7ff255@16| +0#0000000#ffffff0@28
+|~+0#4040ff13&| @2| +0#0000001#ffd7ff255|l|i|n|e| |2| |c|o|l|u|m|n| |6| | +0#4040ff13#ffffff0@28
+|~| @2| +0#0000001#ffd7ff255@16| +0#4040ff13#ffffff0@28
+|~| @48
+|~| @48
+|~| @48
+|~| @48
+| +0#0000000&@31|1|,|1| @10|A|l@1| 
diff --git a/src/testdir/test_balloon.vim b/src/testdir/test_balloon.vim
new file mode 100644
index 0000000..e518755
--- /dev/null
+++ b/src/testdir/test_balloon.vim
@@ -0,0 +1,32 @@
+" Tests for 'balloonevalterm'.
+
+if !has('balloon_eval_term') || has('gui_running')
+  finish
+endif
+
+source screendump.vim
+if !CanRunVimInTerminal()
+  finish
+endif
+
+func Test_balloon_eval_term()
+  call writefile([
+	\ 'call setline(1, ["one one one", "two tXo two", "three three three"])',
+	\ 'set balloonevalterm balloonexpr=MyBalloonExpr() balloondelay=100',
+	\ 'func MyBalloonExpr()',
+	\ ' return "line " . v:beval_lnum . " column " . v:beval_col',
+	\ 'endfun',
+	\ 'redraw',
+	\ 'call test_setmouse(2, 6)',
+	\ 'call feedkeys("\<MouseMove>\<Ignore>", "xt")',
+	\ ], 'XTest_beval')
+
+  " Check that the balloon shows up
+  let buf = RunVimInTerminal('-S XTest_beval', {'rows': 10, 'cols': 50})
+  call term_wait(buf, 100)
+  call VerifyScreenDump(buf, 'Test_balloon_eval_term_01', {})
+
+  " clean up
+  call StopVimInTerminal(buf)
+  call delete('XTest_beval')
+endfunc