From 5a63fb855ff7cb53b590f5fc76515896f00be5fb Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sat, 10 Feb 2024 17:35:48 +0100 Subject: [PATCH] Don't initialize Powerlevel10k "instant prompt" too early A non-login shell which is not a (direct) sub-shells of an AX-ZSH enabled shell will "catch up" on the "ax-io" and "zprofile" stages, so don't initialize the Powerlevel10k "instant prompt" too early, before catching up on the "ax-io" stage! This fixes commit 07d487a. --- ax.zsh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ax.zsh b/ax.zsh index c61fa2e..ec11a3b 100644 --- a/ax.zsh +++ b/ax.zsh @@ -1,5 +1,5 @@ # AX-ZSH: Alex' Modular ZSH Configuration -# Copyright (c) 2015-2022 Alexander Barton +# Copyright (c) 2015-2024 Alexander Barton script_name="${${(%):-%N}:t}" script_type="$script_name[2,-1]" @@ -24,8 +24,13 @@ function axzsh_handle_stage { # [y/n] confirmations, etc.) must be executed before this, so all ax-zsh # 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 + # shells, and in the "zshrc" stage for non-login sub-shells (which have + # the profile already read in and therefore will skip the "ax-io" and + # "zprofile" stages and not catch up). + if [[ \ + ( "$type" == "zprofile" ) || \ + ( ! -o login && "$type" == "zshrc" && -n "$AXZSH_ZPROFILE_READ" ) \ + ]]; then p10k_instant_prompt="${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" [[ -r "$p10k_instant_prompt" ]] && source "$p10k_instant_prompt" fi -- 2.39.2