summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-05-26 08:47:51 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-05-26 08:47:51 +0000
commit70c2da61cf08467d767116456181b851db49bcb0 (patch)
treec17517241181a5fe49e8565f44dc292e0e6b454f /usr.bin
parent1e8cd9d00a45c149cd96a0b680b813074d4ec33e (diff)
Do not try to use the last marked pane if it is invalid.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/cmd-select-pane.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-select-pane.c b/usr.bin/tmux/cmd-select-pane.c
index 57309bbab0b..dcc07200788 100644
--- a/usr.bin/tmux/cmd-select-pane.c
+++ b/usr.bin/tmux/cmd-select-pane.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-select-pane.c,v 1.61 2020/05/16 16:20:59 nicm Exp $ */
+/* $OpenBSD: cmd-select-pane.c,v 1.62 2020/05/26 08:47:50 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -129,7 +129,10 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
if (args_has(args, 'm') || args_has(args, 'M')) {
if (args_has(args, 'm') && !window_pane_visible(wp))
return (CMD_RETURN_NORMAL);
- lastwp = marked_pane.wp;
+ if (server_check_marked())
+ lastwp = marked_pane.wp;
+ else
+ lastwp = NULL;
if (args_has(args, 'M') || server_is_marked(s, wl, wp))
server_clear_marked();