Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262

and supports larger terminals than the older way.

If the new mouse-utf8 option is on, UTF-8 mouse input is enabled for all
UTF-8 terminals. The option defaults to on if LANG etc are set in the
same manner as the utf8 option.

With help and based on code from hsim at gmx.li.
This commit is contained in:
Nicholas Marriott
2011-01-03 23:35:21 +00:00
parent 5158dd9a8d
commit ac3b78a841
11 changed files with 128 additions and 22 deletions

View File

@ -829,6 +829,18 @@ screen_write_insertmode(struct screen_write_ctx *ctx, int state)
s->mode &= ~MODE_INSERT;
}
/* Set UTF-8 mouse mode. */
void
screen_write_utf8mousemode(struct screen_write_ctx *ctx, int state)
{
struct screen *s = ctx->s;
if (state)
s->mode |= MODE_MOUSE_UTF8;
else
s->mode &= ~MODE_MOUSE_UTF8;
}
/* Set mouse mode off. */
void
screen_write_mousemode_off(struct screen_write_ctx *ctx)