mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-22 08:03:54 +01:00
Partly revert previous, it is harmless to keep support for UTF-8 mouse
mode inside tmux, just no longer support it for tmux itself.
This commit is contained in:
parent
32e510bd70
commit
2adf3f42ee
@ -243,11 +243,17 @@ input_key_mouse(struct window_pane *wp, struct mouse_event *m)
|
||||
* is because an old style mouse release event cannot be converted into
|
||||
* the new SGR format, since the released button is unknown). Otherwise
|
||||
* pretend that tmux doesn't speak this extension, and fall back to the
|
||||
* UTF-8 (1005) extension if the application requested, or to the
|
||||
* legacy format.
|
||||
*/
|
||||
if (m->sgr_type != ' ' && (wp->screen->mode & MODE_MOUSE_SGR)) {
|
||||
len = xsnprintf(buf, sizeof buf, "\033[<%u;%u;%u%c",
|
||||
m->sgr_b, x + 1, y + 1, m->sgr_type);
|
||||
} else if (wp->screen->mode & MODE_MOUSE_UTF8) {
|
||||
len = xsnprintf(buf, sizeof buf, "\033[M");
|
||||
len += utf8_split2(m->b + 32, &buf[len]);
|
||||
len += utf8_split2(x + 33, &buf[len]);
|
||||
len += utf8_split2(y + 33, &buf[len]);
|
||||
} else {
|
||||
if (m->b > 223)
|
||||
return;
|
||||
|
6
input.c
6
input.c
@ -1461,6 +1461,9 @@ input_csi_dispatch_rm_private(struct input_ctx *ictx)
|
||||
case 1004:
|
||||
screen_write_mode_clear(&ictx->ctx, MODE_FOCUSON);
|
||||
break;
|
||||
case 1005:
|
||||
screen_write_mode_clear(&ictx->ctx, MODE_MOUSE_UTF8);
|
||||
break;
|
||||
case 1006:
|
||||
screen_write_mode_clear(&ictx->ctx, MODE_MOUSE_SGR);
|
||||
break;
|
||||
@ -1541,6 +1544,9 @@ input_csi_dispatch_sm_private(struct input_ctx *ictx)
|
||||
screen_write_mode_set(&ictx->ctx, MODE_FOCUSON);
|
||||
wp->flags |= PANE_FOCUSPUSH; /* force update */
|
||||
break;
|
||||
case 1005:
|
||||
screen_write_mode_set(&ictx->ctx, MODE_MOUSE_UTF8);
|
||||
break;
|
||||
case 1006:
|
||||
screen_write_mode_set(&ictx->ctx, MODE_MOUSE_SGR);
|
||||
break;
|
||||
|
@ -56,7 +56,7 @@ screen_write_reset(struct screen_write_ctx *ctx)
|
||||
screen_write_scrollregion(ctx, 0, screen_size_y(s) - 1);
|
||||
|
||||
s->mode &= ~(MODE_INSERT|MODE_KCURSOR|MODE_KKEYPAD|MODE_FOCUSON);
|
||||
s->mode &= ~(ALL_MOUSE_MODES|MODE_MOUSE_SGR);
|
||||
s->mode &= ~(ALL_MOUSE_MODES|MODE_MOUSE_UTF8|MODE_MOUSE_SGR);
|
||||
|
||||
screen_write_clearscreen(ctx);
|
||||
screen_write_cursormove(ctx, 0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user