jonmosco / kube-ps1

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

Dynamic context colors #178

Closed Maxence-v closed 1 year ago

Maxence-v commented 1 year ago

Hello,

I'm on zsh MacOS. I use theohmyzsh plugin.

I want to set context colors dynamically.

For ex : if context contains prod: red, pre-prod OR dev: yellow, local: red.

Do you know how can i do this ?

jonmosco commented 1 year ago

Colors can be set using the environment variable as listed in the README. For dynamic coloring like this, I would suggest using the KUBE_PS1_CLUSTER_FUNCTION and the KUBE_PS1_NAMESPACE_FUNCTION.

jonmosco commented 1 year ago

Solution explained. Closing issue.

credativ-dar commented 1 year ago

@Maxence-v that sounds like a great idea to prevent mistakes, could you share your solution?