summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-send-keys.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2010-05-23 19:42:19 +0000
committernicm <nicm@openbsd.org>2010-05-23 19:42:19 +0000
commita0b28a81ed50cec04a78a044c2bed344a18ae74a (patch)
tree0bf255c040c646ccea0e76b7b9efbeaa5444268d /usr.bin/tmux/cmd-send-keys.c
parentWhen executing external mda, call dup2, closefrom, and chdir before (diff)
downloadwireguard-openbsd-a0b28a81ed50cec04a78a044c2bed344a18ae74a.tar.xz
wireguard-openbsd-a0b28a81ed50cec04a78a044c2bed344a18ae74a.zip
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.
Diffstat (limited to 'usr.bin/tmux/cmd-send-keys.c')
-rw-r--r--usr.bin/tmux/cmd-send-keys.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-send-keys.c b/usr.bin/tmux/cmd-send-keys.c
index 095840b6ab7..c6334aac752 100644
--- a/usr.bin/tmux/cmd-send-keys.c
+++ b/usr.bin/tmux/cmd-send-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-send-keys.c,v 1.7 2009/12/03 22:50:10 nicm Exp $ */
+/* $OpenBSD: cmd-send-keys.c,v 1.8 2010/05/23 19:42:19 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -105,16 +105,17 @@ cmd_send_keys_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct cmd_send_keys_data *data = self->data;
struct window_pane *wp;
+ struct session *s;
u_int i;
if (data == NULL)
return (-1);
- if (cmd_find_pane(ctx, data->target, NULL, &wp) == NULL)
+ if (cmd_find_pane(ctx, data->target, &s, &wp) == NULL)
return (-1);
for (i = 0; i < data->nkeys; i++)
- window_pane_key(wp, ctx->curclient, data->keys[i]);
+ window_pane_key(wp, s, data->keys[i]);
return (0);
}