aboutsummaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
Diffstat (limited to '.config')
-rw-r--r--.config/zsh/.zshrc6
1 files changed, 4 insertions, 2 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc
index 3e611ac..c7a759c 100644
--- a/.config/zsh/.zshrc
+++ b/.config/zsh/.zshrc
@@ -20,8 +20,10 @@ else
fi
# Tmux default session
-if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then
- tmux a -t tmux || exec tmux new -s tmux && exit;
+if command -v tmux &> /dev/null && [ -n "$PS1" ] && [ -z "$DISPLAY" ] && [ -z "$TMUX" ]; then
+ if ! tmux list-sessions | grep -q '^tmux:'; then
+ tmux new -s tmux
+ fi
fi
# Enable various options