From 2a1f407b0919c809bace9522abcfee8059d5c840 Mon Sep 17 00:00:00 2001 From: Takashi Yano Date: Sun, 8 Dec 2024 22:27:03 +0900 Subject: Cygwin: console: Ignore intermediate byte in CSI sequence Recent vim throughs the sequence CSI '0%m' that cannot be handled appropriately by psuedo console for a test purpose. This patch removes the intermediate byte ('%') from the sequence. Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/console.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/winsup/cygwin/fhandler/console.cc b/winsup/cygwin/fhandler/console.cc index 0660ee3..c6c2614 100644 --- a/winsup/cygwin/fhandler/console.cc +++ b/winsup/cygwin/fhandler/console.cc @@ -4024,6 +4024,11 @@ fhandler_console::write (const void *vsrc, size_t len) case gotcommand: if (con.nargs < MAXARGS) con.nargs++; + if (*src == '%' && con.nargs == 1 && con.args[0] == 0) + { /* Ignore intermediate byte in CSI sequence used by vim. */ + src++; + break; + } char_command (*src++); con.state = normal; wpbuf.empty(); -- cgit v1.1