From 93230a64bc9369c726cc68d3f539b3bf66cff069 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 19 Jan 2009 18:23:40 +0000 Subject: Pass return code from _exec; allow command sequences to work from the command line. --- cmd-select-prompt.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'cmd-select-prompt.c') diff --git a/cmd-select-prompt.c b/cmd-select-prompt.c index 16c6fe53..753476b0 100644 --- a/cmd-select-prompt.c +++ b/cmd-select-prompt.c @@ -1,4 +1,4 @@ -/* $Id: cmd-select-prompt.c,v 1.5 2009-01-11 00:48:42 nicm Exp $ */ +/* $Id: cmd-select-prompt.c,v 1.6 2009-01-19 18:23:40 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -26,7 +26,7 @@ * Prompt for window index and select it. */ -void cmd_select_prompt_exec(struct cmd *, struct cmd_ctx *); +int cmd_select_prompt_exec(struct cmd *, struct cmd_ctx *); int cmd_select_prompt_callback(void *, const char *); @@ -43,22 +43,21 @@ const struct cmd_entry cmd_select_prompt_entry = { cmd_target_print }; -void +int cmd_select_prompt_exec(struct cmd *self, struct cmd_ctx *ctx) { struct cmd_target_data *data = self->data; struct client *c; if ((c = cmd_find_client(ctx, data->target)) == NULL) - return; + return (-1); if (c->prompt_string != NULL) - return; + return (0); server_set_client_prompt(c, "index ", cmd_select_prompt_callback, c, 0); - if (ctx->cmdclient != NULL) - server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0); + return (0); } int -- cgit