jonmosco / kube-ps1

Kubernetes prompt info for bash and zsh
Apache License 2.0
3.52k stars 351 forks source link

Multiple prompts if I source .zshrc #190

Closed kenfringe closed 3 months ago

kenfringe commented 5 months ago
(⎈cluster:default)@MacBook-Pro ~ % source ~/.zshrc
(⎈|cluster:default))(⎈|cluster:default)@MacBook-Pro ~ % source ~/.zshrc
(⎈|cluster:default))(⎈|cluster:default))(⎈|cluster:default))@MacBook-Pro ~ %
function` get_cluster_short() {
  echo "$1" | cut -d / -f1
}

KUBE_PS1_CLUSTER_FUNCTION=get_cluster_short

source "/opt/homebrew/opt/kube-ps1/share/kube-ps1.sh"
PS1='$(kube_ps1)'$PS1

Why is this happening?

jonmosco commented 3 months ago

Im not sure what your shell configuration looks like, but it looks like on first glance kube-ps1.sh is being sourced two times somewhere. Try to disable all customization and add the prompt by itself to make sure it works properly, then adding in more customizations.

jonmosco commented 3 months ago

Closing this issue. Suspected environment configuration issue.