edit(tmux): start tmux in new session only if server running
This commit is contained in:
parent
3f9bae550d
commit
898b5fea00
@ -5,21 +5,10 @@ if \
|
|||||||
[ "$(tty)" != "/dev/tty3" ] && \
|
[ "$(tty)" != "/dev/tty3" ] && \
|
||||||
[ -z "$TMUX" ] && \
|
[ -z "$TMUX" ] && \
|
||||||
[[ ! "$TERM" =~ tmux ]] && \
|
[[ ! "$TERM" =~ tmux ]] && \
|
||||||
command -v tmux &>/dev/null
|
command -v tmux &>/dev/null && \
|
||||||
|
tmux -N -L "$USER" list-sessions &>/dev/null
|
||||||
then
|
then
|
||||||
if tmux -N -L "$USER" list-sessions &>/dev/null; then
|
|
||||||
if [ -n "$SSH_CLIENT" ]; then
|
|
||||||
exec tmux -N -L "$USER" new-session
|
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
|
fi
|
||||||
|
|
||||||
if [ -f "$HOME/.config/bash/sourcer" ]; then
|
if [ -f "$HOME/.config/bash/sourcer" ]; then
|
||||||
|
|||||||
@ -5,21 +5,10 @@ if \
|
|||||||
[ "$(tty)" != "/dev/tty3" ] && \
|
[ "$(tty)" != "/dev/tty3" ] && \
|
||||||
[ -z "$TMUX" ] && \
|
[ -z "$TMUX" ] && \
|
||||||
[[ ! "$TERM" =~ tmux ]] && \
|
[[ ! "$TERM" =~ tmux ]] && \
|
||||||
command -v tmux &>/dev/null
|
command -v tmux &>/dev/null && \
|
||||||
|
tmux -N -L "$USER" list-sessions &>/dev/null
|
||||||
then
|
then
|
||||||
if tmux -N -L "$USER" list-sessions &>/dev/null; then
|
|
||||||
if [ -n "$SSH_CLIENT" ]; then
|
|
||||||
exec tmux -N -L "$USER" new-session
|
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
|
fi
|
||||||
|
|
||||||
if [ -f "$ZDOTDIR/sourcer" ]; then
|
if [ -f "$ZDOTDIR/sourcer" ]; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user