Problem: Crash when closing terminal popup with <Cmd> mapping.
Solution: Check b_term is not NULL. (closes #7294)
while (blocking || vpeekc_nomap() != NUL)
{
#ifdef FEAT_GUI
- if (!curbuf->b_term->tl_system)
+ if (curbuf->b_term != NULL && !curbuf->b_term->tl_system)
#endif
// TODO: skip screen update when handling a sequence of keys.
// Repeat redrawing in case a message is received while redrawing.
restore_cursor = TRUE;
raw_c = term_vgetc();
-if (raw_c > 0)
- ch_log(NULL, "terminal_loop() got %d", raw_c);
if (!term_use_loop_check(TRUE) || in_terminal_loop != curbuf->b_term)
{
// Job finished while waiting for a character. Push back the
call delete('Xopenterm')
endfunc
+func Test_terminal_popup_with_cmd()
+ " this was crashing
+ let buf = term_start(&shell, #{hidden: v:true})
+ let s:winid = popup_create(buf, {})
+ tnoremap <F3> <Cmd>call popup_close(s:winid)<CR>
+ call feedkeys("\<F3>", 'xt')
+
+ tunmap <F3>
+ exe 'bwipe! ' .. buf
+ unlet s:winid
+endfunc
+
func Check_dump01(off)
call assert_equal('one two three four five', trim(getline(a:off + 1)))
call assert_equal('~ Select Word', trim(getline(a:off + 7)))
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1985,
/**/
1984,
/**/