summaryrefslogtreecommitdiffstats
path: root/cmd-find-window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-01-18 19:10:08 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-01-18 19:10:08 +0000
commit95b14341dd119f8d97d31f3415890656c7644fa9 (patch)
tree2c2493a99606609acc30d6bc49aa8f66d9975f46 /cmd-find-window.c
parentd1a5fde3d074a0aa6d87f3f7494f01554eff17c6 (diff)
Don't die when run non-interactively. DOH.
Diffstat (limited to 'cmd-find-window.c')
-rw-r--r--cmd-find-window.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/cmd-find-window.c b/cmd-find-window.c
index a9c497da..b46884e0 100644
--- a/cmd-find-window.c
+++ b/cmd-find-window.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-find-window.c,v 1.1 2009-01-18 17:20:52 nicm Exp $ */
+/* $Id: cmd-find-window.c,v 1.2 2009-01-18 19:10:08 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -32,8 +32,8 @@ void cmd_find_window_callback(void *, int);
char *cmd_find_window_search(struct window_pane *, const char *);
const struct cmd_entry cmd_find_window_entry = {
- "find-window", NULL,
- CMD_TARGET_WINDOW_USAGE,
+ "find-window", "findw",
+ CMD_TARGET_WINDOW_USAGE " match-string",
CMD_ARG1,
cmd_target_init,
cmd_target_parse,
@@ -53,7 +53,7 @@ cmd_find_window_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct cmd_target_data *data = self->data;
struct cmd_find_window_data *cdata;
- struct session *s = ctx->curclient->session;
+ struct session *s;
struct winlink *wl, *wm;
struct window *w;
struct window_pane *wp;
@@ -62,8 +62,11 @@ cmd_find_window_exec(struct cmd *self, struct cmd_ctx *ctx)
char *sres, *sctx;
u_int i;
- 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;