From a8e8852d6621af961fd8e3d8747022719d695040 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Mon, 31 Jan 2022 15:13:23 +0100 Subject: [PATCH] feat: auto connect to tmux if ssh --- configs/.bashrc | 10 ---------- configs/.zshrc | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/configs/.bashrc b/configs/.bashrc index 660c96b..e59de29 100644 --- a/configs/.bashrc +++ b/configs/.bashrc @@ -112,16 +112,6 @@ if ! shopt -oq posix; then fi fi -if ! command -v tmux &> /dev/null -then - echo " could not be found" - exit -else - # Auto connect to tmux session of ssh - if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then - tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux - fi -fi [ -z $DISPLAY ] && export DISPLAY=127.0.0.1:0.0 . "$HOME/.cargo/env" diff --git a/configs/.zshrc b/configs/.zshrc index b301f51..764f92f 100644 --- a/configs/.zshrc +++ b/configs/.zshrc @@ -75,5 +75,16 @@ fi # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh + + + +# Auto connect to tmux session of ssh +if command -v tmux &> /dev/null +then + if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then + tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux + fi +fi + export PNPM_HOME="$HOME/.local/share/pnpm" export PATH="$PNPM_HOME:$PATH"