comparison 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
comparison
equal deleted inserted replaced
13475:15d3e684a78e 13476:d130044d4f1f
364 364
365 func Test_terminal_finish_open_close() 365 func Test_terminal_finish_open_close()
366 call assert_equal(1, winnr('$')) 366 call assert_equal(1, winnr('$'))
367 367
368 let [cmd, waittime] = s:get_sleep_cmd() 368 let [cmd, waittime] = s:get_sleep_cmd()
369
370 " shell terminal closes automatically
371 terminal
372 let buf = bufnr('%')
373 call assert_equal(2, winnr('$'))
374 " Wait for the shell to display a prompt
375 call WaitFor({-> term_getline(buf, 1) != ""})
376 call Stop_shell_in_terminal(buf)
377 call WaitFor("winnr('$') == 1", waittime)
378
379 " shell terminal that does not close automatically
380 terminal ++noclose
381 let buf = bufnr('%')
382 call assert_equal(2, winnr('$'))
383 " Wait for the shell to display a prompt
384 call WaitFor({-> term_getline(buf, 1) != ""})
385 call Stop_shell_in_terminal(buf)
386 call assert_equal(2, winnr('$'))
387 quit
388 call assert_equal(1, winnr('$'))
369 389
370 exe 'terminal ++close ' . cmd 390 exe 'terminal ++close ' . cmd
371 call assert_equal(2, winnr('$')) 391 call assert_equal(2, winnr('$'))
372 wincmd p 392 wincmd p
373 call WaitFor("winnr('$') == 1", waittime) 393 call WaitFor("winnr('$') == 1", waittime)