Skip to content

Commit 436f9d2

Browse files
brammooldouglasdrumond
authored andcommitted
patch 7.4.766 Problem: Background color check does not work on Tera Term. Solution: Also recognize ST as a termination character. (Hirohito Higashi)
1 parent d9d8cbb commit 436f9d2

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/term.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4264,7 +4264,9 @@ check_termcode(max_offset, buf, bufsize, buflen)
42644264
*
42654265
* - Background color response:
42664266
* <Esc>]11;rgb:{rrrr}/{gggg}/{bbbb}\007
4267-
* The final byte must be '\007'.
4267+
* Or
4268+
* <Esc>]11;rgb:{rrrr}/{gggg}/{bbbb}ST
4269+
* The final byte must be '\007' or ST(0x9c or ESC\).
42684270
*/
42694271
char_u *argp = tp[0] == CSI ? tp + 1 : tp + 2;
42704272

@@ -4408,12 +4410,15 @@ check_termcode(max_offset, buf, bufsize, buflen)
44084410
key_name[1] = (int)KE_IGNORE;
44094411
slen = i + 1;
44104412
}
4411-
else if (*T_RBG != NUL && len >= 24 - (tp[0] == CSI)
4413+
else if (*T_RBG != NUL
4414+
&& len >= 24 - (tp[0] == CSI)
4415+
&& len >= 24 - (tp[0] == CSI) + (argp[21] == ESC)
44124416
&& argp[0] == '1' && argp[1] == '1'
44134417
&& argp[2] == ';' && argp[3] == 'r' && argp[4] == 'g'
44144418
&& argp[5] == 'b' && argp[6] == ':'
44154419
&& argp[11] == '/' && argp[16] == '/'
4416-
&& argp[21] == '\007')
4420+
&& (argp[21] == '\007' || argp[21] == STERM
4421+
|| (argp[21] == ESC && argp[22] == '\\')))
44174422
{
44184423
LOG_TR("Received RBG");
44194424
rbg_status = RBG_GOT;
@@ -4427,7 +4432,7 @@ check_termcode(max_offset, buf, bufsize, buflen)
44274432
}
44284433
key_name[0] = (int)KS_EXTRA;
44294434
key_name[1] = (int)KE_IGNORE;
4430-
slen = 24;
4435+
slen = 24 - (tp[0] == CSI) + (argp[21] == ESC);
44314436
}
44324437
}
44334438

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,8 @@ static char *(features[]) =
756756

757757
static int included_patches[] =
758758
{ /* Add new patch number below this line */
759+
/**/
760+
766,
759761
/**/
760762
765,
761763
/**/

0 commit comments

Comments
 (0)