From 33e9a795321ca5977c648bfa26fb43bc77b4e240 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 29 May 2022 10:43:51 -0700 Subject: fix(home/zsh): don't start tmux when in an ssh session Change-Id: I4a30d787bddbe16026fd8d24378f532696256002 Reviewed-on: https://cl.fcuny.net/c/world/+/166 Reviewed-by: Franck Cuny --- home/zsh/tmux.zsh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'home/zsh') diff --git a/home/zsh/tmux.zsh b/home/zsh/tmux.zsh index 4120512..97944f5 100644 --- a/home/zsh/tmux.zsh +++ b/home/zsh/tmux.zsh @@ -1,3 +1,9 @@ -if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then - tmux attach -t default || tmux new -s default +# If we're not in an ssh connection, and tmux is installed, and we're +# not already in a tmux session, attach to the session named +# 'default', and if the session does not exist, start one named +# 'default' +if [ -z "$SSH_CONNECTION" ]; then + if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then + tmux attach -t default || tmux new -s default + fi fi -- cgit 1.4.1