diff options
-rw-r--r-- | README.md | 20 | ||||
-rw-r--r-- | internal/p10k.zsh | 6 | ||||
-rwxr-xr-x | internal/wizard.zsh | 20 |
3 files changed, 36 insertions, 10 deletions
@@ -34,6 +34,7 @@ it will generate the same prompt. 1. [Why is my cursor in the wrong place?](#why-is-my-cursor-in-the-wrong-place) 1. [Why is my prompt wrapping around in a weird way?](#why-is-my-prompt-wrapping-around-in-a-weird-way) 1. [Why is my right prompt in the wrong place?](#why-is-my-right-prompt-in-the-wrong-place) + 1. [Why does the configuration wizard run automatically every time I start zsh?](#why-does-the-configuration-wizard-run-automatically-every-time-i-start-zsh) 1. [I cannot install the recommended font. Help!](#i-cannot-install-the-recommended-font-help) 1. [Why do I have a question mark symbol in my prompt? Is my font broken?](#why-do-i-have-a-question-mark-symbol-in-my-prompt-is-my-font-broken) 1. [What do different symbols in Git status mean?](#what-do-different-symbols-in-git-status-mean) @@ -100,7 +101,7 @@ supported by Powerlevel10k. ### For new users -On the first run Powerlevel10k configuration wizard will ask you a few questions and configure +On the first run, Powerlevel10k configuration wizard will ask you a few questions and configure your prompt. If it doesn't trigger automatically, type `p10k configure`. You can further customize your prompt by editing `~/.p10k.zsh`. @@ -160,7 +161,7 @@ applications on your system. Configure your terminal to use this font: Run `p10k configure` to pick the best style for your new font. -_Using a different terminal and know how to set font for it? Share your knowledge by sending a PR +_Using a different terminal and know how to set the font for it? Share your knowledge by sending a PR to expand the list!_ ## Try it in Docker @@ -215,7 +216,7 @@ covered by the same license. ### <a name='instant-prompt'></a>What is instant prompt? *Instant Prompt* is an optional feature of Powerlevel10k. When enabled, it gives you a limited -prompt within a few milliseconds of starting zsh, alowing you to start hacking right away while zsh +prompt within a few milliseconds of starting zsh, allowing you to start hacking right away while zsh is initializing. Once initialization is complete, the full-featured Powerlevel10k prompt will seamlessly replace instant prompt. @@ -385,6 +386,19 @@ See [Why is my cursor in the wrong place?](#why-is-my-cursor-in-the-wrong-place) See [Why is my cursor in the wrong place?](#why-is-my-cursor-in-the-wrong-place) +### Why does the configuration wizard run automatically every time I start zsh? + +When Powerlevel10k starts, it automatically runs `p10k configure` if no `POWERLEVEL9K_*` +parameters are defined. Based on your prompt style choices, the configuration wizard creates +`~/.p10k.zsh` with a bunch of `POWERLEVEL9K_*` parameters in it and adds a line to `~/.zshrc` to +source this file. The next time you start zsh, the configuration wizard shouldn't run automatically. +If it does, this means the evaluation of `~/.zshrc` terminates prematurely before it reaches the +line that sources `~/.p10k.zsh`. This most often happens due to syntax errors in `~/.zshrc`. These +errors get hidden by the configuration wizard screen, so you don't notice them. Scroll up in the +first configuration wizard screen to see these errors. Alternatively, run +`POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true zsh` to start zsh without automatically running the +configuration wizard. Once you can see the errors, fix `~/.zshrc` to get rid of them. + ### I cannot install the recommended font. Help! Once you download [the recommended font](#recommended-meslo-nerd-font-patched-for-powerlevel10k), diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c257e6ab..5235aa01 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3740,7 +3740,7 @@ _p9k_set_instant_prompt() { RPROMPT=$saved_rprompt } -typeset -gri __p9k_instant_prompt_version=12 +typeset -gri __p9k_instant_prompt_version=13 _p9k_dump_instant_prompt() { local user=${(%):-%n} @@ -4305,7 +4305,7 @@ function _p9k_on_expand() { () { (( __p9k_ksh_arrays )) && setopt ksh_arrays (( __p9k_sh_glob )) && setopt sh_glob - print -rP -- $ruler + print -rnP -- $ruler } fi } @@ -5472,7 +5472,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v15\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v16\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays' diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 516b1f58..dde6386d 100755 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -350,10 +350,22 @@ function install_font() { print -P "" print -P "Please %Brestart iTerm2%b for the changes to take effect." print -P "" - flowing +c -i 5 " 1. Click" "%BiTerm2 → Quit iTerm2%b" or press "%B⌘ Q%b." - flowing +c -i 5 " 2. Open %BiTerm2%b." - print -P "" - exit 69 + while true; do + flowing +c -i 5 " 1. Click" "%BiTerm2 → Quit iTerm2%b" or press "%B⌘ Q%b." + flowing +c -i 5 " 2. Open %BiTerm2%b." + print -P "" + local key= + read -k key${(%):-"?%BWill you restart iTerm2 before proceeding? [yN]: %b"} || quit -c + if [[ $key = (y|Y) ]]; then + print -P "" + print -P "" + exit 69 + fi + print -P "" + print -P "" + print -P "It's important to %Brestart iTerm2%b for the changes to take effect." + print -P "" + done ;; esac } |