I was wondering if there is a way to detect when I exit a tmux session.
It is common that I have multiple sessions in my workflow and I manage them with tmux-fzf plugin. Everything is good but there are some times when I am done with a session and want to exit it. after exiting, it would completely exit tmux and put me where I ran tmux command in the first place, and if I want to reattach to my sessions, I have to type tmux a. So ideally, I wanted to detect when I exit a session and in my tmux.conf file set a hook to check for existing tmux sessions and if there is attached to them instead of completely detaching from tmux.