From a396df8cea6e563c30555900d841d84c11fd94fb Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Mon, 24 Mar 2025 18:34:20 +0100 Subject: [PATCH] tmux: Fix window reordering >3.4 --- .config/tmux/tmux.conf | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index d215acd..664bf28 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -167,7 +167,18 @@ bind -r N swap-window -d -t :+1 bind -r P swap-window -d -t :-1 # Reorder windows by dragging them in the status line. -bind -n MouseDrag1Status swap-window -d -t= +# NOTE: Omitting the source from 3.4 on (after 8636848e6348) will do nothing, as +# the source is then implied to be the window that the mouse is currently +# on (i.e. also the target) +# TODO: comment on tmux issue #656 +if -F "#{>=:#{version},3.4}" { + # TODO: why does this not work <3.4? + bind -n MouseDrag1Status swap-window -d -s"" -t= +} { + bind -n MouseDrag1Status swap-window -d -t= + # TODO: why does this not work >=3.4? + # bind -n MouseDrag1Status swap-window -d -s":" -t= +} # Move a window to the first or very last position # TODO: do nothing on drags that don't start on a window name