diff options
Diffstat (limited to 'tmux')
-rw-r--r-- | tmux/.config/tmux/ssh.conf | 2 | ||||
-rw-r--r-- | tmux/.config/tmux/tmux.conf | 2 | ||||
-rwxr-xr-x | tmux/.local/bin/tmux-ssh | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/tmux/.config/tmux/ssh.conf b/tmux/.config/tmux/ssh.conf index 4bee96b..b5a5054 100644 --- a/tmux/.config/tmux/ssh.conf +++ b/tmux/.config/tmux/ssh.conf @@ -4,7 +4,5 @@ set-option -g remain-on-exit on set-option -g prefix C-b set-option -g status off -bind-key -n C-a send-prefix - set-hook -g pane-died "detach -E 'tmux -L ssh kill-pane; tmux attach'" diff --git a/tmux/.config/tmux/tmux.conf b/tmux/.config/tmux/tmux.conf index 1bcef1f..28fa23c 100644 --- a/tmux/.config/tmux/tmux.conf +++ b/tmux/.config/tmux/tmux.conf @@ -46,6 +46,8 @@ if "test ! -d $XDG_CONFIG_HOME/tmux/plugins/tpm" \ run '$XDG_CONFIG_HOME/tmux/plugins/tpm/tpm' +set-hook -g session-created 'if -F "#{m/r:^[0-9]+$,#{session_name}}" "rename-session \"#{b:session_path}\""' + %if #{m:*ssh,#{socket_path}} source "$XDG_CONFIG_HOME/tmux/ssh.conf" %endif diff --git a/tmux/.local/bin/tmux-ssh b/tmux/.local/bin/tmux-ssh index b1875e2..6aa5911 100755 --- a/tmux/.local/bin/tmux-ssh +++ b/tmux/.local/bin/tmux-ssh @@ -28,10 +28,10 @@ if [ -z "$1" ]; then fi if [ "$1" = "localhost" ] || [ "$1" = "$HOST" ]; then - tmux detach -E 'tmux attach' + tmux detach -E 'tmux new -A' else if ! tmux -L ssh has-session -t "$1"; then - tmux -L ssh new-session -ds "$1" ssh -t "$1" zsh -l -c tmux new -As "$USER" + tmux -L ssh new-session -ds "$1" ssh -t "$1" "zsh -l -c 'tmux new -A'" fi if [ -z "$TMUX" ]; then |