Pass in the session, rather than the client, to window modes' key()

function. We were only ever using the client to find the session anyway.

This allows send-key to work properly for manipulating copy mode from
outside tmux.

From Micah Cowan.
This commit is contained in:
Nicholas Marriott
2010-05-23 19:42:19 +00:00
parent 0ed727a012
commit 4f5c5b37b8
8 changed files with 33 additions and 34 deletions

View File

@@ -300,7 +300,7 @@ server_client_handle_key(int key, struct mouse_event *mouse, void *data)
server_redraw_window_borders(w);
wp = w->active;
}
window_pane_mouse(wp, c, mouse);
window_pane_mouse(wp, c->session, mouse);
return;
}
@@ -322,7 +322,7 @@ server_client_handle_key(int key, struct mouse_event *mouse, void *data)
/* Try as a non-prefix key binding. */
if ((bd = key_bindings_lookup(key)) == NULL) {
if (!(c->flags & CLIENT_READONLY))
window_pane_key(wp, c, key);
window_pane_key(wp, c->session, key);
} else
key_bindings_dispatch(bd, c);
}
@@ -338,7 +338,7 @@ server_client_handle_key(int key, struct mouse_event *mouse, void *data)
if (isprefix)
c->flags |= CLIENT_PREFIX;
else if (!(c->flags & CLIENT_READONLY))
window_pane_key(wp, c, key);
window_pane_key(wp, c->session, key);
}
return;
}
@@ -349,7 +349,7 @@ server_client_handle_key(int key, struct mouse_event *mouse, void *data)
if (isprefix)
c->flags |= CLIENT_PREFIX;
else if (!(c->flags & CLIENT_READONLY))
window_pane_key(wp, c, key);
window_pane_key(wp, c->session, key);
return;
}