geometry-zsh / geometry

geometry is a minimal, fully customizable and composable zsh prompt theme
ISC License
921 stars 94 forks source link

kube_namespace always resolves to default #267

Closed olegTarassov closed 4 years ago

olegTarassov commented 4 years ago

Switch order because appending color to kube_context fails filter for kube_namespace

olegTarassov commented 4 years ago

any update on this :)

kyounger commented 4 years ago

This might be fixed with #271? It was just merged, so might be worth checking. With that PR, I get proper namespace showing. I did the refactor for that PR, so would be willing to investigate if your issue still persists.

olegTarassov commented 4 years ago

Very nice refactoring! Love the:

kubectl config view --minify --output "jsonpath={..namespace}

Yes it solves the issue but it removed the option to omit the k8s version print.

kyounger commented 4 years ago

@olegTarassov like the git prompt function, you can now just piece together your own segments , and leave out the geometry_kube_version segment altogether. So it still allows you to omit it.

e.g. GEOMETRY_RPROMPT=(geometry_git geometry_exec_time geometry_kube_symbol geometry_kube_context geometry_kube_namespace)

olegTarassov commented 4 years ago

that is definitely the better approach

olegTarassov commented 4 years ago

just tested, it works but now you lose the separator because its not initialized:

  local separator=${GEOMETRY_KUBE_SEPARATOR:-"|"}
  echo -n ${(pj.$separator.)geometry_kube_details}
kyounger commented 4 years ago

What's the value of your GEOMETRY_RPROMPT?

olegTarassov commented 4 years ago
GEOMETRY_INFO=
GEOMETRY_GIT_GREP=ag
GEOMETRY_KUBE_CONTEXT_COLOR=red
GEOMETRY_KUBE_NAMESPACE_COLOR=cyan
GEOMETRY_KUBE_SEPARATOR="|"

GEOMETRY_RPROMPT+=(
    geometry_virtualenv
    geometry_git
    geometry_kube_symbol
    geometry_kube_context
    geometry_kube_namespace
)
kyounger commented 4 years ago

Right the separator is only used with the geometry_kube function. If you piece your prompt together with the helper functions, you'll have to insert the separators yourself.