mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 08:26:56 +00:00
Follow @romkatv suggestion for hostname in title
Thanks, @romkatv
This commit is contained in:
parent
a410d38966
commit
48d5c90bb8
1 changed files with 2 additions and 8 deletions
|
|
@ -267,16 +267,10 @@ _ksi_deferred_init() {
|
|||
fi
|
||||
|
||||
if [[ "$is_ssh_session" == "y" ]]; then
|
||||
# show the hostname via %m for SSH sessions
|
||||
builtin local hostname="$(builtin print -Pn "%m")"
|
||||
# The variable `hostname` is used such that we don't have to use
|
||||
# the -P option in the two print commands below. This mitigating
|
||||
# accidental variable expansion, e.g. of the variables in the
|
||||
# command string (V).
|
||||
functions[_ksi_precmd]+="
|
||||
builtin print -rnu $_ksi_fd \$'\\e]2;'\"$hostname: \${(%):-%(4~|…/%3~|%~)}\"\$'\\a'"
|
||||
builtin print -rnu $_ksi_fd \$'\\e]2;'\"\${(V)HOST-}: \${(%):-%(4~|…/%3~|%~)}\"\$'\\a'"
|
||||
functions[_ksi_preexec]+="
|
||||
builtin print -rnu $_ksi_fd \$'\\e]2;'\"$hostname: \${(V)1}\"\$'\\a'"
|
||||
builtin print -rnu $_ksi_fd \$'\\e]2;'\"\${(V)HOST-}: \${(V)1}\"\$'\\a'"
|
||||
else
|
||||
functions[_ksi_precmd]+="
|
||||
builtin print -rnu $_ksi_fd \$'\\e]2;'\"\${(%):-%(4~|…/%3~|%~)}\"\$'\\a'"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue