diff options
author | Takashi Yano <takashi.yano@nifty.ne.jp> | 2024-12-08 22:27:03 +0900 |
---|---|---|
committer | Takashi Yano <takashi.yano@nifty.ne.jp> | 2024-12-08 22:34:17 +0900 |
commit | 2a1f407b0919c809bace9522abcfee8059d5c840 (patch) | |
tree | 7d423b232b2fdf6dc33e076ef8fa485c9ada88de | |
parent | 0b6b450c64002dcdef09c10176ab181a17e09e52 (diff) | |
download | newlib-2a1f407b0919c809bace9522abcfee8059d5c840.zip newlib-2a1f407b0919c809bace9522abcfee8059d5c840.tar.gz newlib-2a1f407b0919c809bace9522abcfee8059d5c840.tar.bz2 |
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 <takashi.yano@nifty.ne.jp>
-rw-r--r-- | winsup/cygwin/fhandler/console.cc | 5 |
1 files changed, 5 insertions, 0 deletions
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(); |