summaryrefslogtreecommitdiffstats
path: root/cmd-choose-window.c
authornicm <nicm>2009-01-18 19:10:08 (GMT)
committer nicm <nicm>2009-01-18 19:10:08 (GMT)
commit0f5d2f4d9708cf6805248262667b00b0ffc9afa2 (patch) (side-by-side diff)
treef76dd4cc1939479681447ddfbbacb41d6ba1cee4 /cmd-choose-window.c
parentc84eddcbd39397c237d37df4d34caabfc3718fa7 (diff)
downloadtmux-old-0f5d2f4d9708cf6805248262667b00b0ffc9afa2.zip
tmux-old-0f5d2f4d9708cf6805248262667b00b0ffc9afa2.tar.gz
tmux-old-0f5d2f4d9708cf6805248262667b00b0ffc9afa2.tar.bz2
Don't die when run non-interactively. DOH.
Diffstat (limited to 'cmd-choose-window.c') (more/less context) (ignore whitespace changes)
-rw-r--r--cmd-choose-window.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd-choose-window.c b/cmd-choose-window.c
index 2b7f2be..72fe955 100644
--- a/cmd-choose-window.c
+++ b/cmd-choose-window.c
@@ -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;