diff options
author | Franck Cuny <franck@fcuny.net> | 2022-05-29 10:43:51 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-05-29 10:44:57 -0700 |
commit | 33e9a795321ca5977c648bfa26fb43bc77b4e240 (patch) | |
tree | aa7d85f0d0d3e49579323828233a63651ad5e2d0 | |
parent | feat(home/git): add an empty line in the template (diff) | |
download | world-33e9a795321ca5977c648bfa26fb43bc77b4e240.tar.gz |
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 <franck@fcuny.net>
-rw-r--r-- | home/zsh/tmux.zsh | 10 |
1 files changed, 8 insertions, 2 deletions
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 |