I have set my zsh auto start a tmux session when there is no one, like this
if [[ ! $TERM =~ screen ]]; then
exec tmux
fi
Yeah, this works fine, however when I detach the session, the terminal(I am using gnome-shell) will exit too. How do I avoid it
tmuxinstead ofexec, but that just raises the question of why you are usingexecin the first place.tmuxandexec tmux, I just copy from somewhere in this site.