Updated to improve tmux session detection