From 1d00e201a7d2fd9504dbc5e17c834772c898e064 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Wed, 28 Feb 2024 13:09:38 +0100 Subject: [PATCH] tmux: Support dragging into status bar Additionally to dragging a window onto the target destination, add support to drag it further than the outermost windows. --- .config/tmux/tmux.conf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index f80d123..05baed7 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -99,8 +99,13 @@ bind -n MouseDragEnd1Status { setenv -u tmux_move_direction } -# TODO: Move to beginning or end like in MouseDragEnd1Status -# bind -n MouseDragEnd1StatusDefault display-message "#{e|>|f|0:#{mouse_x},#{e|/|f:213,2}}" +# TODO: do nothing on drags that don't start on a window name +bind -n MouseDragEnd1StatusDefault \ + if -F "#{e|>|f|0:#{mouse_x},#{e|/|f:#{window_width},2}}" { + move-window -t #{last_window_index} -a + } { + move-window -t0 + } # Repeatable window-movement bindings bind -r \{ swap-pane -U