Skip to content

Commit 37b5327

Browse files
committed
patch 8.0.1069: still get CTRL-X sometimes
Problem: Still get CTRL-X sometimes for t_RS request. Solution: Also skip 0x18 after a key code response.
1 parent 618d6d2 commit 37b5327

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/term.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4741,9 +4741,10 @@ check_termcode(
47414741
key_name[0] = (int)KS_EXTRA;
47424742
key_name[1] = (int)KE_IGNORE;
47434743
slen = i + 1 + (tp[i] == ESC);
4744-
if (tp[i] == 0x07 && i + 1 < len && tp[i + 1] == 0x18)
4745-
/* Sometimes the 0x07 is followed by 0x18, unclear
4746-
* when this happens. */
4744+
if (rcs_status == STATUS_SENT
4745+
&& slen < len && tp[slen] == 0x18)
4746+
/* Some older xterm send 0x18 for the T_RS request,
4747+
* skip it here. */
47474748
++slen;
47484749
# ifdef FEAT_EVAL
47494750
set_vim_var_string(VV_TERMRGBRESP, tp, slen);
@@ -4793,6 +4794,11 @@ check_termcode(
47934794
key_name[0] = (int)KS_EXTRA;
47944795
key_name[1] = (int)KE_IGNORE;
47954796
slen = i + 1 + (tp[i] == ESC);
4797+
if (rcs_status == STATUS_SENT
4798+
&& slen < len && tp[slen] == 0x18)
4799+
/* Some older xterm send 0x18 for the T_RS request,
4800+
* skip it here. */
4801+
++slen;
47964802
break;
47974803
}
47984804
}

src/version.c

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

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
1069,
772774
/**/
773775
1068,
774776
/**/

0 commit comments

Comments
 (0)