From 77690979159da0b0eba11632ab9d6d4bc325815a Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 28 May 2026 10:34:38 +0000 Subject: [PATCH 1/2] Hide menu options that do not work for floating panes. --- key-bindings.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/key-bindings.c b/key-bindings.c index c341d1bf..4e145a79 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -60,11 +60,11 @@ " '#{?mouse_hyperlink,Type #[underscore]#{=/9/...:mouse_hyperlink},}' 'C-h' {copy-mode -q; send-keys -l -- \"#{q:mouse_hyperlink}\"}" \ " '#{?mouse_hyperlink,Copy #[underscore]#{=/9/...:mouse_hyperlink},}' 'h' {copy-mode -q; set-buffer -- \"#{q:mouse_hyperlink}\"}" \ " ''" \ - " 'Horizontal Split' 'h' {split-window -h}" \ - " 'Vertical Split' 'v' {split-window -v}" \ + " '#{?#{!:#{pane_floating_flag}},Horizontal Split,}' 'h' {split-window -h}" \ + " '#{?#{!:#{pane_floating_flag}},Vertical Split,}' 'v' {split-window -v}" \ " ''" \ - " '#{?#{>:#{window_panes},1},,-}Swap Up' 'u' {swap-pane -U}" \ - " '#{?#{>:#{window_panes},1},,-}Swap Down' 'd' {swap-pane -D}" \ + " '#{?#{&&:#{!:#{pane_floating_flag}},#{>:#{window_panes},1}},Swap Up,}' 'u' {swap-pane -U}" \ + " '#{?#{&&:#{!:#{pane_floating_flag}},#{>:#{window_panes},1}},Swap Down,}' 'd' {swap-pane -D}" \ " '#{?pane_marked_set,,-}Swap Marked' 's' {swap-pane}" \ " ''" \ " 'Kill' 'X' {kill-pane}" \ From 7ebeed1ae728dde6b73106dfbef0ae79dde86253 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 28 May 2026 10:45:17 +0000 Subject: [PATCH 2/2] Do not try to use last pane if there isn't one. --- server-client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server-client.c b/server-client.c index 2ac0eba9..1cd8f4cc 100644 --- a/server-client.c +++ b/server-client.c @@ -1022,7 +1022,8 @@ have_event: /* Only change pane if not already dragging a pane border. */ if (lwp == NULL) { lwp = wp = window_get_active_at(w, px, py); - c->tty.mouse_last_pane = wp->id; + if (wp != NULL) + c->tty.mouse_last_pane = wp->id; } if (c->tty.mouse_scrolling_flag == 0 && loc == KEYC_MOUSE_LOCATION_SCROLLBAR_SLIDER) {