summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2012-09-05 10:14:21 +0000
committernicm <nicm@openbsd.org>2012-09-05 10:14:21 +0000
commita55de104ab986c84f0baada1e5085170a9c34aa4 (patch)
tree54d36d5ee4c96b8416da321973816a79877552f6
parentWe can't tell what the terminal has done with a DCS string, so reset the (diff)
downloadwireguard-openbsd-a55de104ab986c84f0baada1e5085170a9c34aa4.tar.xz
wireguard-openbsd-a55de104ab986c84f0baada1e5085170a9c34aa4.zip
Handle empty list properly in choose-list, based on fix from Thomas Adam.
-rw-r--r--usr.bin/tmux/cmd-choose-list.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/tmux/cmd-choose-list.c b/usr.bin/tmux/cmd-choose-list.c
index 4b71e532143..febbd0e41b1 100644
--- a/usr.bin/tmux/cmd-choose-list.c
+++ b/usr.bin/tmux/cmd-choose-list.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-choose-list.c,v 1.2 2012/09/03 10:02:39 nicm Exp $ */
+/* $Id: cmd-choose-list.c,v 1.3 2012/09/05 10:14:21 nicm Exp $ */
/*
* Copyright (c) 2012 Thomas Adam <thomas@xteddy.org>
@@ -86,6 +86,12 @@ cmd_choose_list_exec(struct cmd *self, struct cmd_ctx *ctx)
}
free(copy);
+ if (idx == 0) {
+ free(template);
+ window_pane_reset_mode(wl->window->active);
+ return (CMD_RETURN_ERROR);
+ }
+
window_choose_ready(wl->window->active, 0, cmd_choose_list_callback,
cmd_choose_list_free);