From 5e36418eb27635116e64ea6cb44d5290bd96fcf3 Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 13 Jun 2026 19:57:44 +0000 Subject: [PATCH] Make the resize keys always change right and bottom borders for floating panes which is more intuitive. --- usr.bin/tmux/key-bindings.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr.bin/tmux/key-bindings.c b/usr.bin/tmux/key-bindings.c index 2373436de92..1ea7795152e 100644 --- a/usr.bin/tmux/key-bindings.c +++ b/usr.bin/tmux/key-bindings.c @@ -1,4 +1,4 @@ -/* $OpenBSD: key-bindings.c,v 1.175 2026/06/13 17:43:20 nicm Exp $ */ +/* $OpenBSD: key-bindings.c,v 1.176 2026/06/13 19:57:44 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -431,13 +431,13 @@ key_bindings_init(void) "bind -N 'Move the visible part of the window left' -r S-Left { refresh-client -L 10 }", "bind -N 'Move the visible part of the window right' -r S-Right { refresh-client -R 10 }", "bind -N 'Reset so the visible part of the window follows the cursor' -r DC { refresh-client -c }", - "bind -N 'Resize the pane up by 5' -r M-Up { resize-pane -U 5 }", + "bind -N 'Resize the pane up by 5' -r M-Up if -F '#{?floating_pane_flag}' { resizep -D-5 } { resize-pane -U 5 }", "bind -N 'Resize the pane down by 5' -r M-Down { resize-pane -D 5 }", - "bind -N 'Resize the pane left by 5' -r M-Left { resize-pane -L 5 }", - "bind -N 'Resize the pane right by 5' -r M-Right { resize-pane -R 5 }", - "bind -N 'Resize the pane up' -r C-Up { resize-pane -U }", + "bind -N 'Resize the pane left by 5' -r M-Left if -F '#{?floating_pane_flag}' { resizep -R-5 } { resize-pane -L 5 }", + "bind -N 'Resize the pane right by 5' -r M-Right resize-pane -R 5", + "bind -N 'Resize the pane up' -r C-Up if -F '#{?floating_pane_flag}' { resizep -D-1 } { resize-pane -U }", "bind -N 'Resize the pane down' -r C-Down { resize-pane -D }", - "bind -N 'Resize the pane left' -r C-Left { resize-pane -L }", + "bind -N 'Resize the pane left' -r C-Left if -F '#{?floating_pane_flag}' { resizep -R-1 } { resize-pane -L }", "bind -N 'Resize the pane right' -r C-Right { resize-pane -R }", /* Menu keys */