tmux: remote config

This commit is contained in:
thek4n 2024-05-24 21:45:45 +03:00
parent 5832c0d707
commit 4d73cecaf1
4 changed files with 22 additions and 3 deletions

View File

@ -3,8 +3,8 @@
if \ if \
[ "$(tty)" != "/dev/tty3" ] && \ [ "$(tty)" != "/dev/tty3" ] && \
[ -z "$TMUX" ] && \
command -v tmux &>/dev/null && \ command -v tmux &>/dev/null && \
[ -z "$TMUX" ] && \
tmux -N -L "$USER" list-sessions &>/dev/null tmux -N -L "$USER" list-sessions &>/dev/null
then then
exec tmux -N -L "$USER" new-session exec tmux -N -L "$USER" new-session
@ -12,4 +12,12 @@ 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"
fi
if \
command -v tmux &>/dev/null && \
[ -n "$TMUX" ] && \
[ -n "$SSH_CLIENT" ]
then
tmux source-file "$XDG_CONFIG_HOME/tmux/remote.conf"
fi fi

View File

@ -50,7 +50,7 @@ bind R command-prompt -I '#S' -p "New session name:" "rename-session '%%'"
# SSH Session # SSH Session
bind H command-prompt -p "Remote host:" "new-session -s 'ssh-%1' -A ssh %1 \; set default-command 'ssh %1' \; set remain-on-exit on \; set detach-on-destroy on" bind H command-prompt -p "Remote host:" "new-session -s 'ssh-%1' -A ssh %1 \; set default-command 'ssh %1' \; set remain-on-exit on"
# Call prompt via prefix ; # Call prompt via prefix ;

View File

@ -0,0 +1,3 @@
# vim: ft=tmux
set detach-on-destroy on

View File

@ -3,8 +3,8 @@
if \ if \
[ "$(tty)" != "/dev/tty3" ] && \ [ "$(tty)" != "/dev/tty3" ] && \
[ -z "$TMUX" ] && \
command -v tmux &>/dev/null && \ command -v tmux &>/dev/null && \
[ -z "$TMUX" ] && \
tmux -N -L "$USER" list-sessions &>/dev/null tmux -N -L "$USER" list-sessions &>/dev/null
then then
exec tmux -N -L "$USER" new-session exec tmux -N -L "$USER" new-session
@ -12,4 +12,12 @@ fi
if [ -f "$ZDOTDIR/sourcer" ]; then if [ -f "$ZDOTDIR/sourcer" ]; then
source "$ZDOTDIR/sourcer" source "$ZDOTDIR/sourcer"
fi
if \
command -v tmux &>/dev/null && \
[ -n "$TMUX" ] && \
[ -n "$SSH_CLIENT" ]
then
tmux source-file "$XDG_CONFIG_HOME/tmux/remote.conf"
fi fi