romkatv / powerlevel10k

A Zsh theme

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting background with "p10k segment -b" is never used

ddribin opened this issue · comments

Hello,

I am trying to create a custom segment using p10k segment, and I've noticed that setting the background color with -b is never used. Trying to set it to red does not work:

  function prompt_drd_dev_env() {
    if [[ ! -z $DRD_DEV_ENV ]]; then
      p10k segment -b red -f white -t "$DRD_DEV_ENV"
    fi
  }
p10k-bg-option

But using the configuration variable POWERLEVEL9K_DRD_DEV_ENV_BACKGROUND does work:

  typeset -g POWERLEVEL9K_DRD_DEV_ENV_BACKGROUND='red'
  function prompt_drd_dev_env() {
    if [[ ! -z $DRD_DEV_ENV ]]; then
      p10k segment -f white -t "$DRD_DEV_ENV"
    fi
  }
p10k-bg-var

Using -b and the variable still does not work, as this still has a red background, as above:

  typeset -g POWERLEVEL9K_DRD_DEV_ENV_BACKGROUND='red'
  function prompt_drd_dev_env() {
    if [[ ! -z $DRD_DEV_ENV ]]; then
      p10k segment -b blue -f white -t "$DRD_DEV_ENV"
    fi
  }

I found Issue #2632, which sounds like this is intended behavior. But I'm not seeing how the -b color is ever used. What is the point of -b if it is always overridden?

I am using the P10k from git at commit 16e5848.

I've replied in the other issue: #2632 (comment)

Alright. Let's close this one.