feat(tmux): if ssh create new tmux session
This commit is contained in:
parent
035a006a72
commit
5d58745a09
@ -7,12 +7,20 @@ if \
|
|||||||
[[ ! "$TERM" =~ tmux ]] && \
|
[[ ! "$TERM" =~ tmux ]] && \
|
||||||
command -v tmux &>/dev/null
|
command -v tmux &>/dev/null
|
||||||
then
|
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
|
exec tmux -N -L "$USER" new-session -A
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ -n "$SSH_CLIENT" ]; then
|
||||||
|
exec tmux new-session
|
||||||
else
|
else
|
||||||
exec tmux new-session -A
|
exec tmux new-session -A
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f "$HOME/.config/bash/sourcer" ]; then
|
if [ -f "$HOME/.config/bash/sourcer" ]; then
|
||||||
source "$HOME/.config/bash/sourcer"
|
source "$HOME/.config/bash/sourcer"
|
||||||
|
|||||||
@ -7,12 +7,20 @@ if \
|
|||||||
[[ ! "$TERM" =~ tmux ]] && \
|
[[ ! "$TERM" =~ tmux ]] && \
|
||||||
command -v tmux &>/dev/null
|
command -v tmux &>/dev/null
|
||||||
then
|
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
|
exec tmux -N -L "$USER" new-session -A
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ -n "$SSH_CLIENT" ]; then
|
||||||
|
exec tmux new-session
|
||||||
else
|
else
|
||||||
exec tmux new-session -A
|
exec tmux new-session -A
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f "$ZDOTDIR/sourcer" ]; then
|
if [ -f "$ZDOTDIR/sourcer" ]; then
|
||||||
source "$ZDOTDIR/sourcer"
|
source "$ZDOTDIR/sourcer"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user