]> arthur.barton.de Git - ax-zsh.git/commitdiff
Initialize Powerlevel10k in non-login shells, too!
authorAlexander Barton <alex@barton.de>
Sat, 10 Feb 2024 10:11:15 +0000 (11:11 +0100)
committerAlexander Barton <alex@barton.de>
Sat, 10 Feb 2024 10:11:15 +0000 (11:11 +0100)
ax.zsh

diff --git a/ax.zsh b/ax.zsh
index b2ee3db9856624f9e2a2c9859f31026d6db70a36..c61fa2e89dbe10ed10ff3d5188e81954f4dd569e 100644 (file)
--- a/ax.zsh
+++ b/ax.zsh
@@ -22,8 +22,10 @@ function axzsh_handle_stage {
        # Enable instant prompt. Should stay close to the top of ~/.zshrc.
        # Initialization code that may require console input (password prompts,
        # [y/n] confirmations, etc.) must be executed before this, so all ax-zsh
-       # plugings should do output in their "ax-io" stage only!
-       if [[ "$type" == "zprofile" ]]; then
+       # plugins should do output in their "ax-io" stage only!
+       # Read the initialization script in the "zprofile" stage for login
+       # shells, and in the "zshrc" stage for non-login shells.
+       if [[ ( -o login && "$type" == "zprofile" ) || ( ! -o login && "$type" == "zshrc" ) ]]; then
                p10k_instant_prompt="${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
                [[ -r "$p10k_instant_prompt" ]] && source "$p10k_instant_prompt"
        fi