Automatic prefix change to C-a when in ssh or mosh session

This commit is contained in:
2026-08-14 09:28:59 +02:00
parent c9daf3ab58
commit 532dc38965
2 changed files with 23 additions and 0 deletions

View File

@@ -18,5 +18,13 @@ set -g @plugin 'tmux-plugins/tmux-sensible'
# set -g @plugin 'git@github.com:user/plugin'
# set -g @plugin 'git@bitbucket.com:user/plugin'
set-window-option -g mode-keys vi
# Auto-switch prefix: C-a for SSH/mosh, C-b for local
set -ga update-environment 'MOSH_SERVER_PID'
set-hook -g session-created 'run-shell ~/.config/tmux-prefix-detect.sh'
set-hook -g client-attached 'run-shell ~/.config/tmux-prefix-detect.sh'
# Manual override: prefix+T to toggle
bind T run-shell ~/.config/tmux-prefix-detect.sh
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'