From 91252d1b54e877dd16ae0f8d4dad9b3fd208d8fc Mon Sep 17 00:00:00 2001 From: Robert Morrison Date: Tue, 6 Dec 2022 16:24:32 +0000 Subject: [PATCH] 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 --- prompt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prompt b/prompt index e910a2f..c6f0686 100755 --- a/prompt +++ b/prompt @@ -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: