comparison src/term.c @ 12497:93a849230c1c v8.0.1128

patch 8.0.1128: old xterm sends CTRL-X in response to t_RS commit https://github.com/vim/vim/commit/e22bbf65088a01b465918919782c19eb291f9cf0 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 19 20:47:16 2017 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Tue, 19 Sep 2017 21:00:04 +0200
parents 68d7bc045dbe
children 3ca08bf99396
comparison
equal deleted inserted replaced
12496:93c55991726c 12497:93a849230c1c
4578 if (version == 115 4578 if (version == 115
4579 && STRNCMP(tp + extra - 2, "0;115;0c", 8) == 0) 4579 && STRNCMP(tp + extra - 2, "0;115;0c", 8) == 0)
4580 is_not_xterm = TRUE; 4580 is_not_xterm = TRUE;
4581 4581
4582 /* Only request the cursor style if t_SH and t_RS are 4582 /* 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
4584 * echoes the characters to the screen. */ 4586 * echoes the characters to the screen. */
4585 if (rcs_status == STATUS_GET 4587 if (rcs_status == STATUS_GET
4588 && version >= 279
4586 && !is_not_xterm 4589 && !is_not_xterm
4587 && *T_CSH != NUL 4590 && *T_CSH != NUL
4588 && *T_CRS != NUL) 4591 && *T_CRS != NUL)
4589 { 4592 {
4590 LOG_TR("Sending cursor style request"); 4593 LOG_TR("Sending cursor style request");
4727 4730
4728 /* got finished code: consume it */ 4731 /* got finished code: consume it */
4729 key_name[0] = (int)KS_EXTRA; 4732 key_name[0] = (int)KS_EXTRA;
4730 key_name[1] = (int)KE_IGNORE; 4733 key_name[1] = (int)KE_IGNORE;
4731 slen = i + 1 + (tp[i] == ESC); 4734 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;
4737 # ifdef FEAT_EVAL 4735 # ifdef FEAT_EVAL
4738 set_vim_var_string(VV_TERMRGBRESP, tp, slen); 4736 set_vim_var_string(VV_TERMRGBRESP, tp, slen);
4739 # endif 4737 # endif
4740 break; 4738 break;
4741 } 4739 }
4780 if (i - j >= 3) 4778 if (i - j >= 3)
4781 got_code_from_term(tp + j, i); 4779 got_code_from_term(tp + j, i);
4782 key_name[0] = (int)KS_EXTRA; 4780 key_name[0] = (int)KS_EXTRA;
4783 key_name[1] = (int)KE_IGNORE; 4781 key_name[1] = (int)KE_IGNORE;
4784 slen = i + 1 + (tp[i] == ESC); 4782 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;
4790 break; 4783 break;
4791 } 4784 }
4792 } 4785 }
4793 else if ((len >= j + 6 && isdigit(argp[3])) 4786 else if ((len >= j + 6 && isdigit(argp[3]))
4794 && argp[4] == ' ' 4787 && argp[4] == ' '
5468 if (orig_mouse_time.tv_sec == 0) 5461 if (orig_mouse_time.tv_sec == 0)
5469 { 5462 {
5470 /* 5463 /*
5471 * Avoid computing the difference between mouse_time 5464 * Avoid computing the difference between mouse_time
5472 * and orig_mouse_time for the first click, as the 5465 * and orig_mouse_time for the first click, as the
5473 * difference would be huge and would cause multiplication 5466 * difference would be huge and would cause
5474 * overflow. 5467 * multiplication overflow.
5475 */ 5468 */
5476 timediff = p_mouset; 5469 timediff = p_mouset;
5477 } 5470 }
5478 else 5471 else
5479 { 5472 {
5480 timediff = (mouse_time.tv_usec 5473 timediff = (mouse_time.tv_usec
5481 - orig_mouse_time.tv_usec) / 1000; 5474 - orig_mouse_time.tv_usec) / 1000;
5482 if (timediff < 0) 5475 if (timediff < 0)
5483 --orig_mouse_time.tv_sec; 5476 --orig_mouse_time.tv_sec;
5484 timediff += (mouse_time.tv_sec 5477 timediff += (mouse_time.tv_sec
5485 - orig_mouse_time.tv_sec) * 1000; 5478 - orig_mouse_time.tv_sec) * 1000;
5486 } 5479 }
5487 orig_mouse_time = mouse_time; 5480 orig_mouse_time = mouse_time;
5488 if (mouse_code == orig_mouse_code 5481 if (mouse_code == orig_mouse_code
5489 && timediff < p_mouset 5482 && timediff < p_mouset
5490 && orig_num_clicks != 4 5483 && orig_num_clicks != 4