Commit: patch 9.2.0184: MS-Windows: screen flicker with termguicolors and visualbell

2 views
Skip to first unread message

Christian Brabandt

unread,
Mar 16, 2026, 6:17:05 PM (7 days ago) Mar 16
to vim...@googlegroups.com
patch 9.2.0184: MS-Windows: screen flicker with termguicolors and visualbell

Commit: https://github.com/vim/vim/commit/74c53196cc108cf744a3f9a6a568bf8c3d75294a
Author: Yasuhiro Matsumoto <matt...@gmail.com>
Date: Mon Mar 16 22:06:47 2026 +0000

patch 9.2.0184: MS-Windows: screen flicker with termguicolors and visualbell

Problem: When 'termguicolors' is used on MS-Windows (VTP mode), sending
CSI query sequences (like DECRQM) causes the console to
generate responses that are misinterpreted as keystrokes.
The leading ESC triggers a beep or 'visualbell' flash.
Solution: In mch_write(), discard CSI sequences when USE_VTP is active
so the console does not process queries and generate unwanted
input responses (Yasuhiro Matsumoto).

related: #11532
closes: #19694

Signed-off-by: Yasuhiro Matsumoto <matt...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/os_win32.c b/src/os_win32.c
index 99acf6afe..62fe2ffb7 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -7440,17 +7440,22 @@ notsgr:
}
else if (s[0] == ESC && len >= 3-1 && s[1] == '[')
{
- int l = 2;
-
- if (SAFE_isdigit(s[l]))
- l++;
- if (s[l] == ' ' && s[l + 1] == 'q')
+ // When USE_VTP is active, CSI sequences written through
+ // write_chars() are interpreted by the console's VTP parser,
+ // generating responses (e.g. DECRQM) that end up in the
+ // input buffer as unwanted keystrokes. Discard them.
+ if (USE_VTP)
{
- // DECSCUSR (cursor style) sequences
- if (vtp_working)
- vtp_printf("%.*s", l + 2, s); // Pass through
- s += l + 2;
- len -= l + 1;
+ int l = 2;
+
+ // skip parameter and intermediate bytes (0x20-0x3F)
+ while (s + l < end && s[l] >= 0x20 && s[l] <= 0x3F)
+ l++;
+ // skip the final byte (0x40-0x7E)
+ if (s + l < end && s[l] >= 0x40 && s[l] <= 0x7E)
+ l++;
+ len -= l - 1;
+ s += l;
}
}
else
diff --git a/src/version.c b/src/version.c
index 60b86018f..0bfaa8e7a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 184,
/**/
183,
/**/
Reply all
Reply to author
Forward
0 new messages