Compare commits

...

2 commits

3 changed files with 19 additions and 3 deletions

View file

@ -146,8 +146,7 @@ if ! shopt -oq posix; then
fi fi
# Customizations # Customizations
if [ -f ~/.profile ] && [ -z "${SSH_CONNECTION}" ]; then
if [ -f ~/.profile ]; then
. ~/.profile . ~/.profile
fi fi

View file

@ -55,7 +55,9 @@ set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum' set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on' set -g @continuum-restore 'on'
set -g @continuum-boot 'on' set -g @continuum-boot 'on'
set -g @resurrect-processes 'ssh nano k9s nvim' set -g @continuum-save-interval '10' # Save every n minutes
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-processes '"~autossh->autossh *" ssh nano k9s nvim'
# Open Links # Open Links
set -g @plugin 'tmux-plugins/tmux-open' set -g @plugin 'tmux-plugins/tmux-open'

15
.zshrc
View file

@ -70,6 +70,21 @@ if [ -z "${SUDO_USER}" ] && [ -z "${SSH_CONNECTION}" ] && [ -z "${TERM_PROGRAM}"
tmux new -A -s local_tmux tmux new -A -s local_tmux
fi fi
# Define a function to use autossh with a custom bashrc
function assh() {
remote_file=$(mktemp)
if $(ssh "$@" "cat > ${remote_file}" < ~/.bashrc > /dev/null 2>&1); then
# Successfully copied bashrc to the remote. Source it upon ssh
autossh -t "$@" "bash --rcfile ${remote_file}; rm ${remote_file}"
else
# SSH Config specifies a RemoteCommand; connect normally
autossh "$@"
fi
}
# Use ssh completion for autossh
compdef autossh=ssh
compdef assh=ssh
# Custom dircolors # Custom dircolors
[ -f ~/.dircolors ] && eval "$(dircolors ~/.dircolors)" [ -f ~/.dircolors ] && eval "$(dircolors ~/.dircolors)"