Commit: patch 9.2.0979: terminal: mouse stays enabled after Vim is killed with SIGTERM

Christian Brabandt <[email protected]>
Newsgroups gmane.editors.vim.devel
Message-ID <[email protected]>
patch 9.2.0979: terminal: mouse stays enabled after Vim is killed with SIGTERM

Commit: https://github.com/vim/vim/commit/f8799c5d0d5bad30e12ee1daa3034a2a58850690
Author: Hirohito Higashi <[email protected]>
Date:   Wed Aug 19 19:14:57 2026 +0000

    patch 9.2.0979: terminal: mouse stays enabled after Vim is killed with SIGTERM
    
    Problem:  After Vim is killed with a deadly signal such as SIGTERM the
              mouse stays enabled in the terminal, so moving the mouse
              afterwards produces escape sequences in the shell
              (Dominik George).
    Solution: Switch the mouse off when exiting after a deadly signal.  The
              terminal mode is restored with "full_screen" already reset,
              which makes settmode() return before it can do this
              (Hirohito Higashi).
    
    fixes:  #21090
    closes: #21095
    
    Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
    Signed-off-by: Hirohito Higashi <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/misc1.c b/src/misc1.c
index 5927768a2..ed81b5ee0 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -2295,6 +2295,11 @@ prepare_to_exit(void)
     {
 	windgoto((int)Rows - 1, cmdline_col_off);
 
+	// When "full_screen" was reset, e.g. by deathtrap(), settmode() below
+	// returns without switching the mouse off, so do it here.
+	if (!full_screen)
+	    mch_setmouse(FALSE);
+
 	/*
 	 * Switch terminal mode back now, so messages end up on the "normal"
 	 * screen (if there are two screens).
diff --git a/src/version.c b/src/version.c
index 326f1df47..257d31223 100644
--- a/src/version.c
+++ b/src/version.c
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    979,
 /**/
     978,
 /**/

-- 
-- 
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/E1wwlzA-00CKwb-TN%40256bit.org.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.