Raise a floating or zoomed pane when its border is clicked.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Michael Grant
2026-10-01 21:01:50 +01:00
parent 64d5c585c6
commit 291c043080
3 changed files with 14 additions and 3 deletions

View File

@@ -524,7 +524,7 @@ key_bindings_init(void)
"bind -n TripleClick1Pane { select-pane -t=; if -F '#{||:#{pane_in_mode},#{mouse_any_flag}}' { send -M } { copy-mode -H; send -X select-line; run -d0.3; send -X copy-pipe-and-cancel } }",
/* Mouse button 1 on border. */
"bind -n MouseDown1Border { select-pane -t= }",
"bind -n MouseDown1Border { select-pane -t=; if -Ft= '#{||:#{pane_floating_flag},#{pane_zoomed_flag}}' { move-pane -t= -P front } }",
/* Mouse button 1 drag on border. */
"bind -n MouseDrag1Border { resize-pane -M }",

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# Moving the mouse onto a pane with focus-follows-mouse makes it active without
# raising it.
# raising it, but clicking a pane's border always brings it to the front.
PATH=/bin:/usr/bin
TERM=screen
@@ -66,5 +66,15 @@ check "$Y" '#{pane_active}:#{pane_z}' '1:0'
mouse '\033[<0;14;12M\033[<0;14;12m'
check "$X" '#{pane_active}:#{pane_z}' '1:0'
# A zoomed pane that is active under a floating pane is not raised by clicking
# inside it, but is raised by clicking on its border.
$TMUX resize-pane -Z -t "$A" || fail "zoom failed"
$TMUX select-pane -t "$Y" || fail "select failed"
$TMUX select-pane -t "$A" || fail "select failed"
check "$A" '#{pane_zoomed_flag}:#{pane_active}' '1:1'
check "$Y" '#{pane_z}' 0
mouse '\033[<0;3;1M\033[<0;3;1m'
check "$A" '#{pane_z}' 0
cleanup
exit 0

3
tmux.1
View File

@@ -6064,7 +6064,8 @@ Moving the mouse onto a pane with
.Ic focus\-follows\-mouse
makes it active without raising it, so
.Ic all
is usually wanted with that option.
is usually wanted with that option, and clicking on the border of a floating or
zoomed pane always raises it.
.Pp
.It Xo Ic pane\-scrollbars
.Op Ic off | modal | on | auto\-hide