tmux for ssh session

This commit is contained in:
thek4n 2023-12-20 23:20:58 +03:00
parent 7cfd04e4b8
commit 8f5735ca01

View File

@ -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