=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/server-client.c,v retrieving revision 1.160 retrieving revision 1.161 diff -c -r1.160 -r1.161 *** src/usr.bin/tmux/server-client.c 2015/10/26 17:17:06 1.160 --- src/usr.bin/tmux/server-client.c 2015/10/26 23:16:18 1.161 *************** *** 1,4 **** ! /* $OpenBSD: server-client.c,v 1.160 2015/10/26 17:17:06 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: server-client.c,v 1.161 2015/10/26 23:16:18 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 551,557 **** if (s == NULL || (c->flags & (CLIENT_DEAD|CLIENT_SUSPENDED)) != 0) return; w = s->curw->window; - wp = w->active; /* Update the activity timer. */ if (gettimeofday(&c->activity_time, NULL) != 0) --- 551,556 ---- *************** *** 592,610 **** m->valid = 1; m->key = key; ! if (!options_get_number(&s->options, "mouse")) { ! window_pane_key(wp, c, s, key, m); ! return; ! } } else m->valid = 0; /* Treat everything as a regular key when pasting is detected. */ ! if (!KEYC_IS_MOUSE(key) && server_client_assume_paste(s)) { ! if (!(c->flags & CLIENT_READONLY)) ! window_pane_key(wp, c, s, key, m); ! return; ! } retry: /* Try to see if there is a key binding in the current table. */ --- 591,604 ---- m->valid = 1; m->key = key; ! if (!options_get_number(&s->options, "mouse")) ! goto forward; } else m->valid = 0; /* Treat everything as a regular key when pasting is detected. */ ! if (!KEYC_IS_MOUSE(key) && server_client_assume_paste(s)) ! goto forward; retry: /* Try to see if there is a key binding in the current table. */ *************** *** 680,686 **** key == options_get_number(&s->options, "prefix2")) { server_client_key_table(c, "prefix"); server_status_client(c); ! } else if (!(c->flags & CLIENT_READONLY)) window_pane_key(wp, c, s, key, m); } --- 674,690 ---- key == options_get_number(&s->options, "prefix2")) { server_client_key_table(c, "prefix"); server_status_client(c); ! return; ! } ! ! forward: ! if (c->flags & CLIENT_READONLY) ! return; ! if (KEYC_IS_MOUSE(key)) ! wp = cmd_mouse_pane(m, NULL, NULL); ! else ! wp = w->active; ! if (wp != NULL) window_pane_key(wp, c, s, key, m); }