aboutsummaryrefslogtreecommitdiff
path: root/cmd-choose-window.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-choose-window.c')
-rw-r--r--cmd-choose-window.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/cmd-choose-window.c b/cmd-choose-window.c
index b071770d..b7f90dc6 100644
--- a/cmd-choose-window.c
+++ b/cmd-choose-window.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-choose-window.c,v 1.5 2009-01-18 17:20:52 nicm Exp $ */
+/* $Id: cmd-choose-window.c,v 1.6 2009-01-18 19:10:08 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -50,13 +50,16 @@ cmd_choose_window_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct cmd_target_data *data = self->data;
struct cmd_choose_window_data *cdata;
- struct session *s = ctx->curclient->session;
+ struct session *s;
struct winlink *wl, *wm;
struct window *w;
u_int idx, cur;
- if (ctx->curclient == NULL)
+ if (ctx->curclient == NULL) {
+ ctx->error(ctx, "must be run interactively");
return;
+ }
+ s = ctx->curclient->session;
if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL)
return;