summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2015-07-03 13:05:50 +0200
committerBram Moolenaar <bram@vim.org>2015-07-03 13:05:50 +0200
commit77a4c150be32cf6bfce6834b5f976ab4d41ad849 (patch)
tree664ae75f4024b8446effa5a913a150de83b2b080
parentb7240c551403d82627cc83086f1d48f651b57510 (diff)
downloadvim-77a4c150be32cf6bfce6834b5f976ab4d41ad849.tar.gz
patch 7.4.766v7.4.766v7-4-766
Problem: Background color check does not work on Tera Term. Solution: Also recognize ST as a termination character. (Hirohito Higashi)
-rw-r--r--src/term.c13
-rw-r--r--src/version.c2
2 files changed, 11 insertions, 4 deletions
diff --git a/src/term.c b/src/term.c
index 8221e3f0..8d8ac407 100644
--- a/src/term.c
+++ b/src/term.c
@@ -4264,7 +4264,9 @@ check_termcode(max_offset, buf, bufsize, buflen)
*
* - Background color response:
* <Esc>]11;rgb:{rrrr}/{gggg}/{bbbb}\007
- * The final byte must be '\007'.
+ * Or
+ * <Esc>]11;rgb:{rrrr}/{gggg}/{bbbb}ST
+ * The final byte must be '\007' or ST(0x9c or ESC\).
*/
char_u *argp = tp[0] == CSI ? tp + 1 : tp + 2;
@@ -4408,12 +4410,15 @@ check_termcode(max_offset, buf, bufsize, buflen)
key_name[1] = (int)KE_IGNORE;
slen = i + 1;
}
- else if (*T_RBG != NUL && len >= 24 - (tp[0] == CSI)
+ else if (*T_RBG != NUL
+ && len >= 24 - (tp[0] == CSI)
+ && len >= 24 - (tp[0] == CSI) + (argp[21] == ESC)
&& argp[0] == '1' && argp[1] == '1'
&& argp[2] == ';' && argp[3] == 'r' && argp[4] == 'g'
&& argp[5] == 'b' && argp[6] == ':'
&& argp[11] == '/' && argp[16] == '/'
- && argp[21] == '\007')
+ && (argp[21] == '\007' || argp[21] == STERM
+ || (argp[21] == ESC && argp[22] == '\\')))
{
LOG_TR("Received RBG");
rbg_status = RBG_GOT;
@@ -4427,7 +4432,7 @@ check_termcode(max_offset, buf, bufsize, buflen)
}
key_name[0] = (int)KS_EXTRA;
key_name[1] = (int)KE_IGNORE;
- slen = 24;
+ slen = 24 - (tp[0] == CSI) + (argp[21] == ESC);
}
}
diff --git a/src/version.c b/src/version.c
index 8336b6d6..ff024760 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 766,
+/**/
765,
/**/
764,