Only set a mouse mode for mouse-select-pane if none already set by the

mode (any will do).
pull/1/head
Nicholas Marriott 2011-01-15 00:46:19 +00:00
parent 8f8e81c0c9
commit 3de1700f61
2 changed files with 14 additions and 9 deletions

View File

@ -449,9 +449,14 @@ server_client_reset_state(struct client *c)
else
tty_cursor(&c->tty, wp->xoff + s->cx, wp->yoff + s->cy);
/*
* Any mode will do for mouse-select-pane, but set standard mode if
* none.
*/
mode = s->mode;
if (TAILQ_NEXT(TAILQ_FIRST(&w->panes), entry) != NULL &&
options_get_number(oo, "mouse-select-pane"))
options_get_number(oo, "mouse-select-pane") &&
(mode & ALL_MOUSE_MODES) == 0)
mode |= MODE_MOUSE_STANDARD;
/*

16
tty.c
View File

@ -401,19 +401,19 @@ tty_update_mode(struct tty *tty, int mode)
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");
if (mode & MODE_MOUSE_ANY)
tty_puts(tty, "\033[?1003h");
else if (mode & MODE_MOUSE_BUTTON)
tty_puts(tty, "\033[?1002h");
else if (mode & MODE_MOUSE_ANY)
tty_puts(tty, "\033[?1003h");
else if (mode & MODE_MOUSE_STANDARD)
tty_puts(tty, "\033[?1000h");
} else {
if (tty->mode & MODE_MOUSE_STANDARD)
tty_puts(tty, "\033[?1000l");
if (tty->mode & MODE_MOUSE_ANY)
tty_puts(tty, "\033[?1003l");
else if (tty->mode & MODE_MOUSE_BUTTON)
tty_puts(tty, "\033[?1002l");
else if (tty->mode & MODE_MOUSE_ANY)
tty_puts(tty, "\033[?1003l");
else if (tty->mode & MODE_MOUSE_STANDARD)
tty_puts(tty, "\033[?1000l");
if (tty->mode & MODE_MOUSE_UTF8)
tty_puts(tty, "\033[?1005l");
}