diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-19 18:23:40 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-19 18:23:40 +0000 |
commit | 93230a64bc9369c726cc68d3f539b3bf66cff069 (patch) | |
tree | 0ad90cda9a0db39a058cbac8ceec67e6e7215354 /cmd-next-window.c | |
parent | 5f6a351df72f76f98ee1ed3494d025fe591fdb69 (diff) |
Pass return code from _exec; allow command sequences to work from the command line.
Diffstat (limited to 'cmd-next-window.c')
-rw-r--r-- | cmd-next-window.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/cmd-next-window.c b/cmd-next-window.c index 72c0f033..cbd74c20 100644 --- a/cmd-next-window.c +++ b/cmd-next-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-next-window.c,v 1.14 2009-01-18 18:31:45 nicm Exp $ */ +/* $Id: cmd-next-window.c,v 1.15 2009-01-19 18:23:40 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -25,7 +25,7 @@ */ void cmd_next_window_init(struct cmd *, int); -void cmd_next_window_exec(struct cmd *, struct cmd_ctx *); +int cmd_next_window_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_next_window_entry = { "next-window", "next", @@ -52,7 +52,7 @@ cmd_next_window_init(struct cmd *self, int key) data->flags |= CMD_AFLAG; } -void +int cmd_next_window_exec(struct cmd *self, struct cmd_ctx *ctx) { struct cmd_target_data *data = self->data; @@ -60,7 +60,7 @@ cmd_next_window_exec(struct cmd *self, struct cmd_ctx *ctx) int activity; if ((s = cmd_find_session(ctx, data->target)) == NULL) - return; + return (-1); activity = 0; if (data->flags & CMD_AFLAG) @@ -68,10 +68,11 @@ cmd_next_window_exec(struct cmd *self, struct cmd_ctx *ctx) if (session_next(s, activity) == 0) server_redraw_session(s); - else + else { ctx->error(ctx, "no next window"); + return (-1); + } recalculate_sizes(); - if (ctx->cmdclient != NULL) - server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0); + return (0); } |