[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:
Fabian IsingandClaude Opus 5.5 committed 2026-10-19 11:18:07 +02:00
1 parent 0db22a9f0c
commit e9a0636d27
2 files changed
+10 -9

No files matched your search

+3 -3
View File
@@ -110,7 +110,7 @@ zstyle :bracketed-paste-magic paste-finish pastefinish
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(bracketed-paste)
# Mirror the ssh destination into a per-pane tmux option; .tmux.conf labels ssh
# panes (window name, pane border only in windows with ssh panes) by title.
# panes with it or the remote's user@host title.
_ssh_host_tmux() {
local -a set=(set -p -t $TMUX_PANE @ssh_host "$1")
[[ -n $1 ]] || set=(set -pu -t $TMUX_PANE @ssh_host)
@@ -146,8 +146,8 @@ _ssh_host_preexec() {
[[ -n $host ]] || return
_ssh_host_tmux $host
_ssh_host_set=1
# pane title starts as the alias; a remote that sets its own title wins.
# Runs after OMZ's preexec, so this replaces its "ssh ..." title.
# title the pane with the alias until the remote sets one; runs after
# OMZ's preexec, so this replaces its "ssh ..." title
print -rn -- $'\e]2;'"$host"$'\e\\'
}
_ssh_host_precmd() {