Mercurial > vim
diff src/testdir/test_terminal.vim @ 12086:69f2392e6cfb v8.0.0923
patch 8.0.0923: crash in GUI when terminal job exits
commit https://github.com/vim/vim/commit/679653e59c6da7f6abc29470ef9d404582bacbb9
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 13 14:13:19 2017 +0200
patch 8.0.0923: crash in GUI when terminal job exits
Problem: Crash in GUI when terminal job exits. (Kazunobu Kuriyama)
Solution: reset in_terminal_loop when a terminal is freed.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 13 Aug 2017 14:15:03 +0200 |
parents | f4e1e1e6886b |
children | 0a61213afdd2 |
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -414,3 +414,23 @@ func Test_terminal_env() exe buf . 'bwipe' endfunc + +" must be last, we can't go back from GUI to terminal +func Test_zz_terminal_in_gui() + if !has('gui') + return + endif + gui -f + + call assert_equal(1, winnr('$')) + let buf = Run_shell_in_terminal({'term_finish': 'close'}) + call Stop_shell_in_terminal(buf) + call term_wait(buf) + + " closing window wipes out the terminal buffer a with finished job + call WaitFor("winnr('$') == 1") + call assert_equal(1, winnr('$')) + call assert_equal("", bufname(buf)) + + unlet g:job +endfunc