romkatv / powerlevel10k

A Zsh theme
MIT License
44.25k stars 2.12k forks source link

Unable to set POWERLEVEL9K_VCS_BRANCH_ICON with Pure #2700

Closed ahmedelgabri closed 3 weeks ago

ahmedelgabri commented 3 weeks ago

I'm trying to migrate from Pure, this is my current pure prompt looks like

Screenshot 2024-06-08 at 22 57 19

This is my current p10k pure one

Screenshot 2024-06-08 at 22 58 22

I still can't manage to set POWERLEVEL9K_VCS_BRANCH_ICON though, the only way I managed to get it working was by manually running the following, but whatever I do inside the file is not reflected in new sessions.

typeset -g POWERLEVEL9K_VCS_BRANCH_ICON="  "
p10k reload

Yet this will still not respect the space after the icon and it will render like this

Screenshot 2024-06-08 at 23 01 15
romkatv commented 3 weeks ago

You need to put POWERLEVEL9K_* parameters in ~/.p10k.zsh.

ahmedelgabri commented 3 weeks ago

@romkatv all the edits were done inside .p10k.zsh file inside $ZDOTDIR/.p10k.zsh

ahmedelgabri commented 3 weeks ago

Here is a video showing the problem, I made the 2nd change to prove that the file is read correctly but some changes are applied while others are not, in this case, POWERLEVEL9K_VCS_BRANCH_ICON

https://github.com/romkatv/powerlevel10k/assets/63876/500b0eaa-7ee1-4709-aaa1-7a1b64599edf

Syphdias commented 3 weeks ago

I just replaced my .p10k.zsh with the pure config and tried what you did and it worked. Do you overwrite it maybe on a later line? Or you have it in another file you source? Does echo $POWERLEVEL9K_VCS_BRANCH_ICON print the icon?

ahmedelgabri commented 3 weeks ago

Do you overwrite it maybe on a later line? Or you have it in another file you source?

Yeah, I found out the problem was here, I had a different file which I source that I tried to set it up there first 🤦🏼

But the problem with respecting the space is still there.

ahmedelgabri commented 3 weeks ago

Ok, I managed to do what I want using the following instead, found out about _PREFIX from this discussion https://github.com/romkatv/powerlevel10k/discussions/2567#discussioncomment-8426041

# I set the icon here
typeset -g POWERLEVEL9K_VCS_PREFIX='  '
# I remove the icon from here
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=