feat(tmux): if ssh create new tmux session

This commit is contained in:
thek4n 2024-04-16 13:22:13 +03:00
parent 035a006a72
commit 5d58745a09
2 changed files with 22 additions and 6 deletions

View File

@ -7,11 +7,19 @@ if \
[[ ! "$TERM" =~ tmux ]] && \
command -v tmux &>/dev/null
then
if systemctl -q --user is-active tmux; then
if tmux -N -L "$USER" server-info &>/dev/null; then
if [ -n "$SSH_CLIENT" ]; then
exec tmux -N -L "$USER" new-session
else
exec tmux -N -L "$USER" new-session -A
fi
else
if [ -n "$SSH_CLIENT" ]; then
exec tmux new-session
else
exec tmux new-session -A
fi
fi
fi
if [ -f "$HOME/.config/bash/sourcer" ]; then

View File

@ -7,11 +7,19 @@ if \
[[ ! "$TERM" =~ tmux ]] && \
command -v tmux &>/dev/null
then
if systemctl -q --user is-active tmux; then
if tmux -N -L "$USER" server-info &>/dev/null; then
if [ -n "$SSH_CLIENT" ]; then
exec tmux -N -L "$USER" new-session
else
exec tmux -N -L "$USER" new-session -A
fi
else
if [ -n "$SSH_CLIENT" ]; then
exec tmux new-session
else
exec tmux new-session -A
fi
fi
fi
if [ -f "$ZDOTDIR/sourcer" ]; then