patch 9.2.0437: MS-Windows: cursor flicker in vtp mode

Commit: 
https://github.com/vim/vim/commit/9d3019104c37bad56ff5bdc7614b26cb3fea7ce4
Author: Yasuhiro Matsumoto <[email protected]>
Date:   Sun May 3 18:37:05 2026 +0000

    patch 9.2.0437: MS-Windows: cursor flicker in vtp mode
    
    Problem:  MS-Windows: cursor flicker in vtp mode
    Solution: Skip mch_update_cursor() in cursor_visible() when vtp is
              active (Yasuhiro Matsumoto).
    
    In vtp (ConPTY) mode the cursor visibility is controlled by DECTCEM
    ( [?25h /  [?25l).  The follow-up call to mch_update_cursor() then
    re-emits DECSCUSR ( [0 q etc.) on every visibility toggle even though
    the cursor shape did not change.  Some terminals briefly redisplay the
    cursor when DECSCUSR arrives, so this can cause a visible flash at the
    position the cursor will be moved to next (e.g. column 0 ahead of a line
    redraw).
    
    In non-vtp mode the call is still required because SetConsoleCursorInfo()
    inside mch_set_cursor_shape() reads s_cursor_visible to apply the
    visibility change, so keep that path unchanged.
    
    closes: #20122
    
    Signed-off-by: Yasuhiro Matsumoto <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/os_win32.c b/src/os_win32.c
index e8f8162f1..ab12d5a05 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -7104,9 +7104,19 @@ cursor_visible(BOOL fVisible)
     s_cursor_visible = fVisible;
 
     if (vtp_working)
+    {
+       // In vtp mode, visibility is controlled solely by DECTCEM.  Skip
+       // mch_update_cursor() since shape is independent of visibility and
+       // re-emitting DECSCUSR can cause the terminal to briefly redisplay
+       // the cursor while a redraw is in progress.
        vtp_printf(" [?25%c", fVisible ? 'h' : 'l');
+       return;
+    }
 
 # ifdef MCH_CURSOR_SHAPE
+    // Non-vtp Windows console: SetConsoleCursorInfo() consults
+    // s_cursor_visible inside mch_set_cursor_shape(), so the call is needed
+    // to apply the new visibility.
     mch_update_cursor();
 # endif
 }
diff --git a/src/version.c b/src/version.c
index f377ae58e..597842bf9 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 */
+/**/
+    437,
 /**/
     436,
 /**/

-- 
-- 
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/E1wJboQ-0047rr-Ad%40256bit.org.

Raspunde prin e-mail lui