[TMUX][ZSH] Label ssh panes with remote title or host alias

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Fabian IsingandClaude Opus 5.5 committed 2026-10-19 11:14:48 +02:00
1 parent 93400d68ab
commit 0db22a9f0c
2 files changed
+59

No files matched your search

+9
View File
@@ -43,6 +43,15 @@ bind - run-shell 'v="#{@venv}"; d="#{pane_current_path}"; if [ -n "$v" ]; then t
# its global env carries one), regardless of what the source pane had.
bind c new-window -e VIRTUAL_ENV=
# ssh panes: the shell sets #{@ssh_host} and the pane title to the alias (see
# zsh/lib/interactive.zsh); a remote that sets its own title overrides the
# latter. Label ssh panes by title in the window name and, only in windows with
# an ssh pane, in the pane border.
set -g automatic-rename-format '#{?#{@ssh_host},#{=40:pane_title},#{?pane_in_mode,[tmux],#{pane_current_command}}#{?pane_dead,[dead],}}'
set -g pane-border-format '#{?#{@ssh_host},#[bold] #{=60:pane_title} #[default],}'
set-hook -g window-layout-changed \
'if -F "#{P:#{@ssh_host}}" "set -w pane-border-status top" "set -wu pane-border-status"'
# Switch windows
bind-key -n M-Left select-window -t -1
bind-key -n M-Right select-window -t +1