summaryrefslogtreecommitdiffstats
path: root/cmd-send-keys.c
diff options
context:
space:
mode:
authornicm <nicm>2009-01-19 18:23:40 +0000
committernicm <nicm>2009-01-19 18:23:40 +0000
commit2fd1100a3889ead3be34561fe55c3317a655940c (patch)
tree3691d38b018b82aacfe685a5c890ea3d4efec4aa /cmd-send-keys.c
parent5abf6bb85a525ce227997f14cb442d6d0d97cf0b (diff)
downloadtmux-old-2fd1100a3889ead3be34561fe55c3317a655940c.tar.gz
tmux-old-2fd1100a3889ead3be34561fe55c3317a655940c.tar.bz2
tmux-old-2fd1100a3889ead3be34561fe55c3317a655940c.zip
Pass return code from _exec; allow command sequences to work from the command line.
Diffstat (limited to 'cmd-send-keys.c')
-rw-r--r--cmd-send-keys.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/cmd-send-keys.c b/cmd-send-keys.c
index 6ea49b8e..545089cd 100644
--- a/cmd-send-keys.c
+++ b/cmd-send-keys.c
@@ -27,7 +27,7 @@
*/
int cmd_send_keys_parse(struct cmd *, int, char **, char **);
-void cmd_send_keys_exec(struct cmd *, struct cmd_ctx *);
+int cmd_send_keys_exec(struct cmd *, struct cmd_ctx *);
void cmd_send_keys_send(struct cmd *, struct buffer *);
void cmd_send_keys_recv(struct cmd *, struct buffer *);
void cmd_send_keys_free(struct cmd *);
@@ -106,7 +106,7 @@ usage:
return (-1);
}
-void
+int
cmd_send_keys_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct cmd_send_keys_data *data = self->data;
@@ -114,18 +114,17 @@ cmd_send_keys_exec(struct cmd *self, struct cmd_ctx *ctx)
u_int i;
if (data == NULL)
- return;
+ return (-1);
if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL)
- return;
+ return (-1);
for (i = 0; i < data->nkeys; i++) {
window_pane_key(
wl->window->active, ctx->curclient, data->keys[i]);
}
- if (ctx->cmdclient != NULL)
- server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0);
+ return (0);
}
void