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

toolbox segment not showing after entering a distrobox container #1915

Open
christian-schulze opened this issue Jun 24, 2022 · 1 comment
Open

Comments

@christian-schulze
Copy link
Contributor

christian-schulze commented Jun 24, 2022

I've been playing with distrobox containers, and noticed that you have added a toolbox segment which also supports distrobox. PR for distrobox support here #1696.

I found the relevant detection code here internal/p10k.zsh. Specifically the elif block:

  elif [[ -n $DISTROBOX_ENTER_PATH && -n $NAME ]]; then
    local name=${(%):-%m}
    if [[ $name == $NAME* ]]; then
      typeset -g P9K_TOOLBOX_NAME=$name
    fi
  fi

I found the $NAME env var is empty, so the block is skipped. Updating this to $HOST works (ZSH builtin env var). the updated code looks like this:

  elif [[ -n $DISTROBOX_ENTER_PATH && -n $HOST ]]; then
    local name=${(%):-%m}
    if [[ $name == $NAME* ]]; then
      typeset -g P9K_TOOLBOX_NAME=$name
    fi
  fi

I'm using Fedora 36 as the host OS and Ubuntu 22.04 as the distrobox container (also tested archlinux container with the same result).

What are your thoughts on my update above? PR here: #1916

@romkatv
Copy link
Owner

romkatv commented Jul 20, 2022

Fixed via #1916

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