From ec9c3d65d460e14f4576d74ec1842059f592a913 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 1 Mar 2015 13:34:08 +0100 Subject: zprofile: clean up tmux sessions when detaching Signed-off-by: Florian Pritz --- .zprofile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to '.zprofile') 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 -- cgit v1.2.3-24-g4f1b