Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

next-window on window close?

13 views
Skip to first unread message

miostreams

unread,
Dec 11, 2024, 9:37:02 AM12/11/24
to tmux-users
Is it possible to change the default behavior so that the next window is selected when the current window is closed?

Scenario
  • Create 4 windows with ssh sessions.
  • From the 4th window, exit the ssh session.
  • tmux automatically moves to the last window used (3rd window).
I have tried using 'detach-on-destroy next', but that does not seem to provide the expected behavior:

set -g detach-on-destroy next

Thank you

Nicholas Marriott

unread,
Dec 11, 2024, 4:18:15 PM12/11/24
to miostreams, tmux-users

There is nothing built in. Maybe you could try doing something with the window-close hook.



--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/tmux-users/b98dfd68-b48a-4dc7-8b4f-3debece81b20n%40googlegroups.com.

M Kelly

unread,
Dec 13, 2024, 4:50:41 PM12/13/24
to tmux-users
Hi,

Something like this perhaps ?

set-hook -g 'pane-exited'    'run "tmux select-window -n"'

-m
Reply all
Reply to author
Forward
0 new messages