From d8ef83b59a22f124276fae57bfcb4df43c709afb Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 16 Mar 2019 14:10:19 +0100 Subject: [PATCH] be more aggressive in attempt to maintain correct prompt options --- powerlevel9k.zsh-theme | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 37366fc9..9821d500 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1991,6 +1991,8 @@ typeset -g _P9K_RIGHT_SUFFIX set_default POWERLEVEL9K_DISABLE_RPROMPT false typeset -fH _p9k_set_prompt() { + emulate -L zsh + _P9K_PROMPT='' build_left_prompt PROMPT=$_P9K_LEFT_PREFIX$_P9K_PROMPT$_P9K_LEFT_SUFFIX @@ -2024,7 +2026,9 @@ powerlevel9k_prepare_prompts() { _P9K_PIPE_EXIT_CODES=( "$pipestatus[@]" ) _P9K_COMMAND_DURATION=$((EPOCHREALTIME - _P9K_TIMER_START)) - emulate -L zsh + unsetopt local_options + prompt_opts=(cr percent sp subst) + setopt nopromptbang prompt{cr,percent,sp,subst} _p9k_init _P9K_TIMER_START=1e10 @@ -2276,9 +2280,6 @@ typeset -gi _P9K_ENABLED=0 prompt_powerlevel9k_setup() { prompt_powerlevel9k_teardown - prompt_opts=(cr percent sp subst) - setopt nopromptbang prompt{cr,percent,sp,subst} - add-zsh-hook precmd powerlevel9k_prepare_prompts add-zsh-hook preexec powerlevel9k_preexec