mirror of
https://github.com/tmux/tmux.git
synced 2024-11-18 10:28:54 +00:00
Merge branch 'obsd-master'
This commit is contained in:
commit
3f47ff6ecd
@ -242,11 +242,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