=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/server-client.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- src/usr.bin/tmux/server-client.c 2011/01/01 01:12:09 1.47 +++ src/usr.bin/tmux/server-client.c 2011/01/03 23:35:21 1.48 @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.47 2011/01/01 01:12:09 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.48 2011/01/03 23:35:21 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -451,6 +451,21 @@ if (TAILQ_NEXT(TAILQ_FIRST(&w->panes), entry) != NULL && options_get_number(oo, "mouse-select-pane")) mode |= MODE_MOUSE_STANDARD; + + /* + * Set UTF-8 mouse input if required. If the terminal is UTF-8, the + * user has set mouse-utf8 and any mouse mode is in effect, turn on + * UTF-8 mouse input. If the receiving terminal hasn't requested it + * (that is, it isn't in s->mode), then it'll be converted in + * input_mouse. + */ + if ((c->tty.flags & TTY_UTF8) && + (mode & ALL_MOUSE_MODES) && options_get_number(oo, "mouse-utf8")) + mode |= MODE_MOUSE_UTF8; + else + mode &= ~MODE_MOUSE_UTF8; + + /* Set the terminal mode and reset attributes. */ tty_update_mode(&c->tty, mode); tty_reset(&c->tty); }