summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-choose-buffer.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2013-03-21 16:09:59 +0000
committernicm <nicm@openbsd.org>2013-03-21 16:09:59 +0000
commit92e215b64336bbf89705dcfcc03f359e9818eb62 (patch)
tree04125a4fd3419dcf1fc6a573bc3b0812b02a8aaa /usr.bin/tmux/cmd-choose-buffer.c
parentRemove free callback for window_choose_data objects. (diff)
downloadwireguard-openbsd-92e215b64336bbf89705dcfcc03f359e9818eb62.tar.xz
wireguard-openbsd-92e215b64336bbf89705dcfcc03f359e9818eb62.zip
Allow choose commands to be used outside tmux, so long as at least one
client is attached.
Diffstat (limited to 'usr.bin/tmux/cmd-choose-buffer.c')
-rw-r--r--usr.bin/tmux/cmd-choose-buffer.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-choose-buffer.c b/usr.bin/tmux/cmd-choose-buffer.c
index 75c293d61d1..54236b1f973 100644
--- a/usr.bin/tmux/cmd-choose-buffer.c
+++ b/usr.bin/tmux/cmd-choose-buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-choose-buffer.c,v 1.12 2013/03/21 16:09:17 nicm Exp $ */
+/* $OpenBSD: cmd-choose-buffer.c,v 1.13 2013/03/21 16:09:59 nicm Exp $ */
/*
* Copyright (c) 2010 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -51,11 +51,10 @@ cmd_choose_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
const char *template;
u_int idx;
- 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;
if ((template = args_get(args, 'F')) == NULL)
template = CHOOSE_BUFFER_TEMPLATE;