From 4b4f514c1586f343a714949efa2e0686b291f7d2 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 23 Feb 2020 18:32:59 +0100 Subject: [PATCH 1/2] =?UTF-8?q?add=20=E2=87=A042=E2=87=A242=20to=20the=20g?= =?UTF-8?q?it=20status=20prompt=20example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b4b82322..5672eeef 100644 --- a/README.md +++ b/README.md @@ -708,7 +708,7 @@ Zsh but it won't do anything. When using Lean, Classic or Rainbow style, Git status may look like this: ```text -feature:master ⇣42⇡42 *42 merge ~42 +42 !42 ?42 +feature:master ⇣42⇡42 ⇠42⇢42 *42 merge ~42 +42 !42 ?42 ``` | Symbol | Meaning | Source | From a2689e757d5bc2fb792379fe2998b370e4f6a169 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 24 Feb 2020 06:51:13 +0100 Subject: [PATCH 2/2] don't reset prompt when precmd is called from zle --- internal/p10k.zsh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index a67a5091..d6707fbf 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6041,7 +6041,9 @@ _p9k_precmd_impl() { preexec_functions=(${(@)preexec_functions:#_p9k_preexec2} _p9k_preexec2) fi + __p9k_reset_state=1 _p9k_worker_receive + __p9k_reset_state=0 } _p9k_trapint() { @@ -6067,14 +6069,19 @@ _p9k_precmd() { } function _p9k_reset_prompt() { - if zle && [[ -z $_p9k__line_finished ]]; then + if (( __p9k_reset_state != 1 )) && zle && [[ -z $_p9k__line_finished ]]; then + __p9k_reset_state=0 setopt prompt_subst (( __p9k_ksh_arrays )) && setopt ksh_arrays (( __p9k_sh_glob )) && setopt sh_glob (( _p9k__can_hide_cursor )) && echoti civis - zle .reset-prompt - zle -R - (( _p9k__can_hide_cursor )) && echoti cnorm + { + zle .reset-prompt + zle -R + } always { + (( _p9k__can_hide_cursor )) && echoti cnorm + _p9k__cursor_hidden=0 + } fi } @@ -6699,7 +6706,6 @@ function _p9k_on_widget_zle-line-finish() { echo -nE - $hide$'\n'$termcap[up] fi _p9k_reset_prompt - __p9k_reset_state=0 fi _p9k__line_finished='%{%}' @@ -7898,7 +7904,6 @@ function p10k() { done if (( __p9k_reset_state == -1 )); then _p9k_reset_prompt - __p9k_reset_state=0 fi ;; configure)