Sync OpenBSD patchset 828:

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:
Tiago Cunha
2011-01-07 14:34:45 +00:00
parent 3aaf5b9b1e
commit 219442cff7
11 changed files with 139 additions and 33 deletions

6
tty.c
View File

@ -1,4 +1,4 @@
/* $Id: tty.c,v 1.198 2010-12-30 22:27:38 tcunha Exp $ */
/* $Id: tty.c,v 1.199 2011-01-07 14:34:45 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -405,6 +405,8 @@ tty_update_mode(struct tty *tty, int mode)
}
if (changed & ALL_MOUSE_MODES) {
if (mode & ALL_MOUSE_MODES) {
if (mode & MODE_MOUSE_UTF8)
tty_puts(tty, "\033[?1005h");
if (mode & MODE_MOUSE_STANDARD)
tty_puts(tty, "\033[?1000h");
else if (mode & MODE_MOUSE_HIGHLIGHT)
@ -422,6 +424,8 @@ tty_update_mode(struct tty *tty, int mode)
tty_puts(tty, "\033[?1002l");
else if (tty->mode & MODE_MOUSE_ANY)
tty_puts(tty, "\033[?1003l");
if (tty->mode & MODE_MOUSE_UTF8)
tty_puts(tty, "\033[?1005l");
}
}
if (changed & MODE_KKEYPAD) {