From 8f5735ca019573ccb27e2c2b96a08997883cbab1 Mon Sep 17 00:00:00 2001 From: thek4n Date: Wed, 20 Dec 2023 23:20:58 +0300 Subject: [PATCH] tmux for ssh session --- home/user/.zprofile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/home/user/.zprofile b/home/user/.zprofile index 0a32608..e020aab 100644 --- a/home/user/.zprofile +++ b/home/user/.zprofile @@ -6,6 +6,10 @@ fi if systemctl -q is-active graphical.target && [[ $(tty) = "/dev/tty1" ]] && [[ -z $DISPLAY ]] && [[ $XDG_VTNR -eq 1 ]]; then exec startx >> ~/.xlogs 2>&1 -elif command -v tmux &>/dev/null && [[ $(tty) = "/dev/tty2" ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then +elif command -v tmux &>/dev/null && [[ $(tty) = "/dev/tty2" ]] && [[ ! "$TERM" =~ tmux ]] && [[ -z "$TMUX" ]]; then exec tmux new-session fi + +if [[ -n "$SSH_CLIENT" ]] && [[ ! "$TERM" =~ tmux ]] && [[ -z "$TMUX" ]]; then + exec tmux new-session -s ssh -A +fi