Powerlevel9k / powerlevel9k

Powerlevel9k was a tool for building a beautiful and highly functional CLI, customized for you. P9k had a substantial impact on CLI UX, and its legacy is now continued by P10k.
https://github.com/romkatv/powerlevel10k
MIT License
13.46k stars 949 forks source link

POWERLEVEL9K_DIR_BACKGROUND not affecting prompt #1403

Closed Gary-Armstrong closed 4 years ago

Gary-Armstrong commented 4 years ago

Describe Your Issue

What is happening? Changing POWERLEVEL9K_DIR_BACKGROUND in .zshrc not reflected after source ~/.zshrc I searched issues, did not find any similar, and therefore assume I am doing something wrong.

Have you tried to debug or fix it?

Just started customizing this morning after doing a git pull. I'm assuming I'm doing something wrong here. Read the docs. Changing the aws segment color works fine.

What I have in .zshrc now: POWERLEVEL9K_PROMPT_ON_NEWLINE=true POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir aws vcs) POWERLEVEL9K_DIR_BACKGROUND='white' POWERLEVEL9K_AWS_FOREGROUND='yellow'

The aws segment is yellow on red but the dir segment is black on blue. I toggled the settings a few times to confirm this behavior.

Environment Information

This information will help us understand your configuration.

Issues with Fonts & Icons

Probably not a font issue. ===== Font debugging ===== You are using iTerm2 with Font DroidSansMonoForPowerline 11

Your font settings seem to be all right. If you still have issues, it is more likely to be a font issue than a Powerlevel9k related one.

romkatv commented 4 years ago

dir has states, so you need to set POWERLEVEL9K_DIR_${STATE}_BACKGROUND instead of POWERLEVEL9K_DIR_BACKGROUND. Accepted values of ${STATE} are: DEFAULT, HOME, HOME_SUBFOLDER, NOT_WRITABLE and ETC.

Gary-Armstrong commented 4 years ago

Yep, my bad here. Thanks for the tip. Got it working like so: POWERLEVEL9K_DIR_HOME_FOREGROUND='white' POWERLEVEL9K_DIR_HOME_BACKGROUND='019' POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND='white' POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND='019' POWERLEVEL9K_AWS_FOREGROUND='000' POWERLEVEL9K_AWS_BACKGROUND='142'

romkatv commented 4 years ago

Note that you'll still get the original colors when your current directory is outside of $HOME. To get the same colors everywhere you need to override colors for all 5 states.