summaryrefslogtreecommitdiffstats
path: root/cmd-select-pane.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 03:34:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 03:34:56 +0000
commitc294c2bf54a3ec56271a78c284f84e75a8119731 (patch)
treef1fed2d81b80619666e9508fa5051bcfc34fae5f /cmd-select-pane.c
parentReleasing progress-linux version 3.3a-5~progress7.99u1. (diff)
downloadtmux-c294c2bf54a3ec56271a78c284f84e75a8119731.tar.xz
tmux-c294c2bf54a3ec56271a78c284f84e75a8119731.zip
Merging upstream version 3.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmd-select-pane.c')
-rw-r--r--cmd-select-pane.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd-select-pane.c b/cmd-select-pane.c
index ae21d4c..135729f 100644
--- a/cmd-select-pane.c
+++ b/cmd-select-pane.c
@@ -98,7 +98,11 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
struct options_entry *o;
if (entry == &cmd_last_pane_entry || args_has(args, 'l')) {
- lastwp = w->last;
+ /*
+ * Check for no last pane found in case the other pane was
+ * spawned without being visited (for example split-window -d).
+ */
+ lastwp = TAILQ_FIRST(&w->last_panes);
if (lastwp == NULL && window_count_panes(w) == 2) {
lastwp = TAILQ_PREV(w->active, window_panes, entry);
if (lastwp == NULL)