use tmux on shell start

This commit is contained in:
Simonas Narbutas
2018-07-24 16:38:03 +02:00
parent 1f4ba21976
commit 26cac08868

11
.zsh.d/40-always-tmux.zsh Normal file
View File

@@ -0,0 +1,11 @@
if [[ "$TERM" == screen* ]] || [[ -n "$TMUX" ]]; then
return 1
fi
if tmux list-sessions && (tmux list-sessions | test -n "$0"); then
session_id=`date +%Y%m%d%H%M%S`
tmux new-session -d -t base -s $session_id
tmux attach-session -t $session_id \; set-option destroy-unattached
else
tmux new-session -s base
fi