summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.zprofile5
1 files changed, 4 insertions, 1 deletions
diff --git a/.zprofile b/.zprofile
index 46d8309..846316d 100644
--- a/.zprofile
+++ b/.zprofile
@@ -4,7 +4,10 @@ if tty -s && [[ -z $DISPLAY ]]; then
if ! tmux has -t "autosession"; then
exec tmux new -s "autosession"
else
- exec tmux new -t "autosession"
+ session=$(tmux new-session -t "autosession" -P -F "#{session_name}" -d)
+ tmux attach-session -t $session
+ tmux kill-session -t $session
+ exit
fi
fi
fi