mirror of
https://github.com/vim/vim.git
synced 2026-06-14 15:37:28 +02:00
patch 9.2.0593: :wqall ignores term_setkill() on running terminal buffers
Problem: :wqall ignores term_setkill() on running terminal buffers
Solution: In do_wqall(), call term_try_stop_job() on the running
terminal buffer first (Foxe Chen).
closes: #20417
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
b42e805733
commit
2271d062e5
+5
-2
@@ -2515,8 +2515,11 @@ do_wqall(exarg_T *eap)
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (exiting && !eap->forceit && term_job_running(buf->b_term))
|
||||
{
|
||||
no_write_message_buf(buf);
|
||||
++error;
|
||||
if (term_try_stop_job(buf) == FAIL)
|
||||
{
|
||||
no_write_message_buf(buf);
|
||||
++error;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
@@ -1334,7 +1334,7 @@ endfunc
|
||||
|
||||
" Run Vim, start a terminal in that Vim with the kill argument,
|
||||
" :qall works.
|
||||
func Run_terminal_qall_kill(line1, line2)
|
||||
func Run_terminal_qall_kill_int(line1, line2, cmd)
|
||||
" 1. Open a terminal window and wait for the prompt to appear
|
||||
" 2. set kill using term_setkill()
|
||||
" 3. make Vim exit, it will kill the shell
|
||||
@@ -1346,7 +1346,7 @@ func Run_terminal_qall_kill(line1, line2)
|
||||
\ 'endwhile',
|
||||
\ a:line2,
|
||||
\ 'au VimLeavePre * call writefile(["done"], "Xdone")',
|
||||
\ 'qall',
|
||||
\ a:cmd,
|
||||
\ ]
|
||||
if !RunVim([], after, '')
|
||||
return
|
||||
@@ -1355,6 +1355,11 @@ func Run_terminal_qall_kill(line1, line2)
|
||||
call delete("Xdone")
|
||||
endfunc
|
||||
|
||||
func Run_terminal_qall_kill(line1, line2)
|
||||
call Run_terminal_qall_kill_int(a:line1, a:line2, 'qall')
|
||||
call Run_terminal_qall_kill_int(a:line1, a:line2, 'wqall')
|
||||
endfunc
|
||||
|
||||
" Run Vim in a terminal, then start a terminal in that Vim with a kill
|
||||
" argument, check that :qall works.
|
||||
func Test_terminal_qall_kill_arg()
|
||||
|
||||
@@ -729,6 +729,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
593,
|
||||
/**/
|
||||
592,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user