summaryrefslogtreecommitdiffstats
path: root/cmd-choose-list.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2013-02-10 17:52:51 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2013-02-10 17:52:51 +0000
commitf1ce95915c612ef3b429dc7d2f635b5758b27669 (patch)
tree4151a79b448c88fb48972a8466f7d19bfd1cbf28 /cmd-choose-list.c
parentaadc87f5a79865f404f4b6cb0f4892daa17e7365 (diff)
Allow choose commands to be used outside tmux, so long as at least one client
is attached.
Diffstat (limited to 'cmd-choose-list.c')
-rw-r--r--cmd-choose-list.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd-choose-list.c b/cmd-choose-list.c
index 136cd4c4..9634fef4 100644
--- a/cmd-choose-list.c
+++ b/cmd-choose-list.c
@@ -47,13 +47,14 @@ enum cmd_retval
cmd_choose_list_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct args *args = self->args;
+ struct client *c;
struct winlink *wl;
const char *list1;
char *template, *item, *copy, *list;
u_int idx;
- if (ctx->curclient == NULL) {
- ctx->error(ctx, "must be run interactively");
+ if ((c = cmd_current_client(ctx)) == NULL) {
+ ctx->error(ctx, "no client available");
return (CMD_RETURN_ERROR);
}
@@ -77,7 +78,7 @@ cmd_choose_list_exec(struct cmd *self, struct cmd_ctx *ctx)
{
if (*item == '\0') /* no empty entries */
continue;
- window_choose_add_item(wl->window->active, ctx, wl, item,
+ window_choose_add_item(wl->window->active, c, wl, item,
template, idx);
idx++;
}