Allow choose commands to be used outside tmux, so long as at least one client

is attached.
This commit is contained in:
Nicholas Marriott
2013-02-10 17:52:51 +00:00
parent aadc87f5a7
commit f1ce95915c
8 changed files with 30 additions and 40 deletions

View File

@ -139,11 +139,10 @@ cmd_find_window_exec(struct cmd *self, struct cmd_ctx *ctx)
const char *template;
u_int i, match_flags;
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);
}
c = ctx->curclient;
s = c->session;
if ((wl = cmd_find_window(ctx, args_get(args, 't'), NULL)) == NULL)