comparison src/testdir/test_terminal.vim @ 19629:804322d6c6ba v8.2.0371

patch 8.2.0371: crash with combination of terminal popup and autocmd Commit: https://github.com/vim/vim/commit/cee52204ca030ce7814844e4dab8b4ed897ba3cc Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 11 14:19:58 2020 +0100 patch 8.2.0371: crash with combination of terminal popup and autocmd Problem: Crash with combination of terminal popup and autocmd. Solution: Disallow closing a popup that is the current window. Add a check that the current buffer is valid. (closes #5754)
author Bram Moolenaar <Bram@vim.org>
date Wed, 11 Mar 2020 14:30:04 +0100
parents 47db1e17d0a4
children dd3e5533a7d2
comparison
equal deleted inserted replaced
19628:a9fb9a329b79 19629:804322d6c6ba
2428 func Test_hidden_terminal() 2428 func Test_hidden_terminal()
2429 let buf = term_start(&shell, #{hidden: 1}) 2429 let buf = term_start(&shell, #{hidden: 1})
2430 call assert_equal('', bufname('^$')) 2430 call assert_equal('', bufname('^$'))
2431 call StopShellInTerminal(buf) 2431 call StopShellInTerminal(buf)
2432 endfunc 2432 endfunc
2433
2434 func Test_term_nasty_callback()
2435 func OpenTerms()
2436 set hidden
2437 let g:buf0 = term_start('sh', #{hidden: 1})
2438 call popup_create(g:buf0, {})
2439 let g:buf1 = term_start('sh', #{hidden: 1, term_finish: 'close'})
2440 call popup_create(g:buf1, {})
2441 let g:buf2 = term_start(['sh', '-c'], #{curwin: 1, exit_cb: function('TermExit')})
2442 sleep 100m
2443 call popup_close(win_getid())
2444 endfunc
2445 func TermExit(...)
2446 call term_sendkeys(bufnr('#'), "exit\<CR>")
2447 call popup_close(win_getid())
2448 endfu
2449 call OpenTerms()
2450
2451 call term_sendkeys(g:buf0, "exit\<CR>")
2452 sleep 50m
2453 exe g:buf0 .. 'bwipe'
2454 set hidden&
2455 endfunc
2456