Skip to content

Commit e22bbf6

Browse files
committed
patch 8.0.1128: old xterm sends CTRL-X in response to t_RS
Problem: Old xterm sends CTRL-X in response to t_RS. Solution: Only send t_RS for xterm 279 and later. Remove the workaround to ignore CTRL-X.
1 parent a8e93d6 commit e22bbf6

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

src/term.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4580,9 +4580,12 @@ check_termcode(
45804580
is_not_xterm = TRUE;
45814581

45824582
/* Only request the cursor style if t_SH and t_RS are
4583-
* set. Not for Terminal.app, it can't handle t_RS, it
4583+
* set. Only supported properly by xterm since version
4584+
* 279 (otherwise it returns 0x18).
4585+
* Not for Terminal.app, it can't handle t_RS, it
45844586
* echoes the characters to the screen. */
45854587
if (rcs_status == STATUS_GET
4588+
&& version >= 279
45864589
&& !is_not_xterm
45874590
&& *T_CSH != NUL
45884591
&& *T_CRS != NUL)
@@ -4729,11 +4732,6 @@ check_termcode(
47294732
key_name[0] = (int)KS_EXTRA;
47304733
key_name[1] = (int)KE_IGNORE;
47314734
slen = i + 1 + (tp[i] == ESC);
4732-
if (rcs_status == STATUS_SENT
4733-
&& slen < len && tp[slen] == 0x18)
4734-
/* Some older xterm send 0x18 for the T_RS request,
4735-
* skip it here. */
4736-
++slen;
47374735
# ifdef FEAT_EVAL
47384736
set_vim_var_string(VV_TERMRGBRESP, tp, slen);
47394737
# endif
@@ -4782,11 +4780,6 @@ check_termcode(
47824780
key_name[0] = (int)KS_EXTRA;
47834781
key_name[1] = (int)KE_IGNORE;
47844782
slen = i + 1 + (tp[i] == ESC);
4785-
if (rcs_status == STATUS_SENT
4786-
&& slen < len && tp[slen] == 0x18)
4787-
/* Some older xterm send 0x18 for the T_RS request,
4788-
* skip it here. */
4789-
++slen;
47904783
break;
47914784
}
47924785
}
@@ -5470,19 +5463,19 @@ check_termcode(
54705463
/*
54715464
* Avoid computing the difference between mouse_time
54725465
* and orig_mouse_time for the first click, as the
5473-
* difference would be huge and would cause multiplication
5474-
* overflow.
5466+
* difference would be huge and would cause
5467+
* multiplication overflow.
54755468
*/
54765469
timediff = p_mouset;
54775470
}
54785471
else
54795472
{
54805473
timediff = (mouse_time.tv_usec
5481-
- orig_mouse_time.tv_usec) / 1000;
5474+
- orig_mouse_time.tv_usec) / 1000;
54825475
if (timediff < 0)
54835476
--orig_mouse_time.tv_sec;
54845477
timediff += (mouse_time.tv_sec
5485-
- orig_mouse_time.tv_sec) * 1000;
5478+
- orig_mouse_time.tv_sec) * 1000;
54865479
}
54875480
orig_mouse_time = mouse_time;
54885481
if (mouse_code == orig_mouse_code

src/version.c

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

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1128,
764766
/**/
765767
1127,
766768
/**/

0 commit comments

Comments
 (0)