Posted on :: Tags: , , ,

When I close a window in tmux, it typically activates the window to its right. I prefer the previously active window to be activated instead. I couldn’t find a direct setting for this, but tmux provides hooks for various events. By setting the window-unlinked hook to trigger last-window, I can achieve the desired behavior.

Add the following to your .tmux.conf:

set-hook -g window-unlinked 'last-window'