summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-03-01 13:34:08 +0100
committerFlorian Pritz <bluewind@xinu.at>2015-03-01 13:34:08 +0100
commitec9c3d65d460e14f4576d74ec1842059f592a913 (patch)
tree0c85c1947f49c1b9258158799e8dc7ba9b4140f3
parent305106d6f486066331b3e36080604a62766df150 (diff)
downloaddotfiles-ec9c3d65d460e14f4576d74ec1842059f592a913.tar.gz
dotfiles-ec9c3d65d460e14f4576d74ec1842059f592a913.tar.xz
zprofile: clean up tmux sessions when detaching
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-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