tmux: remote config
This commit is contained in:
parent
5832c0d707
commit
4d73cecaf1
@ -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
|
||||||
@ -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 ;
|
||||||
|
|||||||
3
home/user/.config/tmux/remote.conf
Normal file
3
home/user/.config/tmux/remote.conf
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# vim: ft=tmux
|
||||||
|
|
||||||
|
set detach-on-destroy on
|
||||||
@ -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
|
||||||
Loading…
x
Reference in New Issue
Block a user