patch 9.2.0593: :wqall ignores term_setkill() on running terminal buffers

Commit: 
https://github.com/vim/vim/commit/2271d062e59dfcf409f2674d14e0bb9994f418c0
Author: Foxe Chen <[email protected]>
Date:   Wed Jun 3 19:18:04 2026 +0000

    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 <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 7999cba0e..cedb9edf8 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 c6521d3ef..2c6dca1e3 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 250b63815..cacb63cb8 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,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1wUrHv-003uIY-Sv%40256bit.org.

Raspunde prin e-mail lui