From: Foxe Chen Date: Wed, 3 Jun 2026 19:18:04 +0000 (+0000) Subject: patch 9.2.0593: :wqall ignores term_setkill() on running terminal buffers X-Git-Tag: v9.2.0593^0 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=2271d062e59dfcf409f2674d14e0bb9994f418c0;p=thirdparty%2Fvim.git 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 Signed-off-by: Christian Brabandt --- diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 7999cba0e0..cedb9edf88 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -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 diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index c6521d3efe..2c6dca1e39 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -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() diff --git a/src/version.c b/src/version.c index 250b638153..cacb63cb8c 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 593, /**/ 592, /**/