mirror of
https://github.com/tmux/tmux.git
synced 2025-09-04 23:56:58 +00:00
Allow choose commands to be used outside tmux, so long as at least one client
is attached.
This commit is contained in:
@ -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++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user