Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instant Prompt not sourcing my ~/.p10k.zsh file #2792

Open
nickw8 opened this issue Nov 15, 2024 · 1 comment
Open

Instant Prompt not sourcing my ~/.p10k.zsh file #2792

nickw8 opened this issue Nov 15, 2024 · 1 comment

Comments

@nickw8
Copy link

nickw8 commented Nov 15, 2024

When I open my terminal, I get a generic(?) p10k theme. I then have to source my ~/.p10k.zsh file to get the theme I set up.

Here is an image. I started my terminal and then on the first line sourced ~/.p10k.zsh. You can see how it starts with one theme and then uses my theme when I source ~/.p10k.zsh:

image

I am using zinit to install and in my .zshrc I have the p10k stuff like this after I initialize zinit:

# # ---- p10k instant prompt -----
zinit ice id-as depth=1; zinit light romkatv/powerlevel10k
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
# [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

NOTE: I get the same problem no matter where I put the instant prompt code, at the top or after zinit initialization.

I have been looking through the other issues and didn't find anything that helped me but hopefully found stuff to help you diagnose the issue.

❯ locale; _p9k_can_configure -q; typeset -pm '__p9k_zshrc|__p9k_zshrc_u|__p9k_zd|__p9k_zd_u|ZDOTDIR|__p9k_cfg_*|POWERLEVEL9K_CONFIG_FILE'
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
typeset POWERLEVEL9K_CONFIG_FILE=/home/nick/.p10k.zsh
typeset -r __p9k_zshrc_u='~/.zshrc'
typeset __p9k_cfg_path=/home/nick/.p10k.zsh
typeset -r __p9k_zd_u='~'
typeset -r __p9k_zshrc=/home/nick/.zshrc
typeset __p9k_cfg_path_o=/home/nick/.p10k.zsh
typeset __p9k_cfg_path_u=/home/nick/.p10k.zsh
typeset __p9k_cfg_basename=.p10k.zsh
typeset -r __p9k_zd=/home/nick

Anything else I can do to provide context to figure this out?

Thanks for any help

@romkatv
Copy link
Owner

romkatv commented Nov 16, 2024

Try this:

if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

zinit ice depth=1; zinit light romkatv/powerlevel10k
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants