aboutsummaryrefslogtreecommitdiff
path: root/cmd-select-prompt.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-select-prompt.c')
-rw-r--r--cmd-select-prompt.c13
1 files changed, 6 insertions, 7 deletions
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 <nicm@users.sourceforge.net>
@@ -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