aboutsummaryrefslogtreecommitdiff
path: root/cmd-find-window.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-find-window.c')
-rw-r--r--cmd-find-window.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/cmd-find-window.c b/cmd-find-window.c
index 29ac2845..8d34e60e 100644
--- a/cmd-find-window.c
+++ b/cmd-find-window.c
@@ -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)