Mercurial > vim
diff src/testdir/test_terminal.vim @ 13476:d130044d4f1f v8.0.1612
patch 8.0.1612: need to close terminal after shell stopped
commit https://github.com/vim/vim/commit/1dd98334d6daee8abefcd640291d4b777d9f0f96
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Mar 16 22:54:53 2018 +0100
patch 8.0.1612: need to close terminal after shell stopped
Problem: Need to close terminal after shell stopped.
Solution: Make :terminal without argument close the window by default.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 16 Mar 2018 23:00:07 +0100 |
parents | 568dcfac9daf |
children | 661394686fd8 |
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -367,6 +367,26 @@ func Test_terminal_finish_open_close() let [cmd, waittime] = s:get_sleep_cmd() + " shell terminal closes automatically + terminal + let buf = bufnr('%') + call assert_equal(2, winnr('$')) + " Wait for the shell to display a prompt + call WaitFor({-> term_getline(buf, 1) != ""}) + call Stop_shell_in_terminal(buf) + call WaitFor("winnr('$') == 1", waittime) + + " shell terminal that does not close automatically + terminal ++noclose + let buf = bufnr('%') + call assert_equal(2, winnr('$')) + " Wait for the shell to display a prompt + call WaitFor({-> term_getline(buf, 1) != ""}) + call Stop_shell_in_terminal(buf) + call assert_equal(2, winnr('$')) + quit + call assert_equal(1, winnr('$')) + exe 'terminal ++close ' . cmd call assert_equal(2, winnr('$')) wincmd p