refactor(prompt): Move set term title to precmd

Moved the setTermTitle function call out of the prompt line and into the
precmd hook.
This shortens the non-visible length of the prompt line and also makes
the functionality clearer
This commit is contained in:
Robert Morrison 2022-12-06 16:24:32 +00:00
parent ab222a30c7
commit 91252d1b54
Signed by: robert
GPG Key ID: 73E012EB3F4EC696

3
prompt
View File

@ -26,9 +26,10 @@ zstyle ':vcs_info:git*' actionformats "-(%{%F{203}%} %{%f%}%s:%{%F{2}%}שׂ %{
## precmd runs before every prompt
precmd() {
vcs_info
setTermTitle "($(whoami)@$(hostname) $(pwd))"
}
PROMPT="$(setTermTitle "(%n@%m %2~)")╭╼(%{%F{81}%}%n%{%F{245}%}@%{%F{206}%}%m %{%F{245}%}%2~%{%F{259}%})─(%(?.😎.😞 %?))"$'\n'"╰┤"
PROMPT="╭╼(%{%F{81}%}%n%{%F{245}%}@%{%F{206}%}%m %{%F{245}%}%2~%{%F{259}%})─(%(?.😎.😞 %?))"$'\n'"╰┤"
export RPROMPT='${vcs_info_msg_0_}'
# vim: set ft=zsh: