1
0
forked from aniani/vim

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.
This commit is contained in:
Bram Moolenaar
2018-03-16 22:54:53 +01:00
parent af23bad0fd
commit 1dd98334d6
4 changed files with 51 additions and 6 deletions

View File

@@ -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