all repos — nixfiles @ e2d85d381b0a3e827e9bf37dd6c527d6b08044d6

System and user configuration, managed by nix and home-manager

zsh: Set or unset window title according to host

Alan Pearce
commit

e2d85d381b0a3e827e9bf37dd6c527d6b08044d6

parent

10c8548d14e2349ff9bdcf0aa2f26b2e8eadd012

1 file changed, 12 insertions(+), 0 deletions(-)

jump to
M tag-zsh/config/zsh/zshrctag-zsh/config/zsh/zshrc
@@ -217,6 +217,18 @@ precmd_functions+=(update_terminalapp_cwd)
# Run once to get initial cwd set update_terminalapp_cwd fi + + function set_window_title { printf '\e]2;%s\a' "$1" } + + function update_window_title { + if [[ -n "$SSH_CONNECTION" || $UID -eq 0 ]] + then + set_window_title "$USER@$HOST" + else + set_window_title "" + fi + } + precmd_functions+=(update_window_title) fi if zplug check clvv/fasd