[TMUX] Fall back to ssh alias unless remote title is user@host
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0db22a9f0c
commit
e9a0636d27
2 files changed
+10
-9
No files matched your search
+7
-6
@@ -43,12 +43,13 @@ 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],}'
|
||||
# ssh panes: the shell sets #{@ssh_host} to the alias (see
|
||||
# zsh/lib/interactive.zsh). Label them with the remote's title if it is a bare
|
||||
# user@host (as our server zsh pins it), else with the alias; in the window
|
||||
# name and, only in windows with an ssh pane, in the pane border.
|
||||
set -g @ssh_label '#{?#{m/r:^[^@: ]+@[^@: ]+$,#{pane_title}},#{pane_title},#{@ssh_host}}'
|
||||
set -g automatic-rename-format '#{?#{@ssh_host},#{=40:#{E:@ssh_label}},#{?pane_in_mode,[tmux],#{pane_current_command}}#{?pane_dead,[dead],}}'
|
||||
set -g pane-border-format '#{?#{@ssh_host},#[bold] #{=60:#{E:@ssh_label}} #[default],}'
|
||||
set-hook -g window-layout-changed \
|
||||
'if -F "#{P:#{@ssh_host}}" "set -w pane-border-status top" "set -wu pane-border-status"'
|
||||
|
||||
|
||||
Reference in new issue
Block a user