Hi, Something like this perhaps ?
set-hook -g 'pane-exited' 'run "tmux select-window -n"' -m On Wednesday, December 11, 2024 at 4:18:15 PM UTC-5 Nicholas Marriott wrote: > There is nothing built in. Maybe you could try doing something with the > window-close hook. > > > On Wed, 11 Dec 2024, 14:37 miostreams, <m.ios...@gmail.com> wrote: > >> 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 >> >> -- >> 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 >> >> <https://groups.google.com/d/msgid/tmux-users/b98dfd68-b48a-4dc7-8b4f-3debece81b20n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- 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+unsubscr...@googlegroups.com. To view this discussion, visit https://groups.google.com/d/msgid/tmux-users/061dc123-3107-4fc7-8f4b-cfc8a0550799n%40googlegroups.com.