aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2017-04-20 18:49:24 +0300
committerGitHub <noreply@github.com>2017-04-20 18:49:24 +0300
commit2f462bd33a8102125c569a1d36c959a16171238d (patch)
tree00550308e84cd3da37861c282f303303c0b40133
parent25fc2fb03e37eb232bbcb0f63a791fc78d491b6f (diff)
parentefac911431c98062cc9d792f08ce70060844c468 (diff)
Merge pull request #496 from belak/options-oddities
Fix some oddities with prompt options
-rwxr-xr-xpowerlevel9k.zsh-theme16
1 files changed, 10 insertions, 6 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 4d8d1c39..a718d931 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1336,6 +1336,16 @@ prompt_powerlevel9k_setup() {
# Maximum integer on 32-bit CPUs
_P9K_TIMER_START=2147483647
+ # The prompt function will set these prompt_* options after the setup function
+ # returns. We need prompt_subst so we can safely run commands in the prompt
+ # without them being double expanded and we need prompt_percent to expand the
+ # common percent escape sequences.
+ prompt_opts=(subst percent)
+
+ # Borrowed from promptinit, sets the prompt options in case the theme was
+ # not initialized via promptinit.
+ setopt noprompt{bang,cr,percent,subst} "prompt${^prompt_opts[@]}"
+
# Display a warning if the terminal does not support 256 colors
local term_colors
term_colors=$(echotc Co 2>/dev/null)
@@ -1367,12 +1377,6 @@ prompt_powerlevel9k_setup() {
)
print_deprecation_warning deprecated_segments
- setopt prompt_subst
-
- setopt LOCAL_OPTIONS
- unsetopt XTRACE KSH_ARRAYS
- setopt PROMPT_CR PROMPT_PERCENT PROMPT_SUBST MULTIBYTE
-
# initialize colors
autoload -U colors && colors