How to get kube-ps1 to work in Wrap terminal?

338 Views Asked by At

I'm trying to move from iterm2 to warp, but one thing that I can't get working, which is quite crucial for me, is the kube-ps1 project. What it does is to make the current Kubernetes context visible at the prompt like this:

enter image description here

In iterm2, this indicates that I'm in the "prod" Kubernetes context. I'm using Oh My Zsh in iterm2, and just installed it using the docs on the page:

brew install kube-ps1

I've then done the following since I'm using zsh (ohmyzsh):

plugins=(
  kube-ps1
)

PROMPT='$(kube_ps1)'$PROMPT # or RPROMPT='$(kube_ps1)'

In iterm2, it now works correctly (after running kubeon) and I can see the kubernetes context in the prompt, but it doens't seem to work in Warp.

I've also tried this:

$ source /opt/homebrew/Cellar/kube-ps1/0.8.0/share/kube-ps1.sh
PROMPT='$(kube_ps1)'$PROMPT # or RPROMPT='$(kube_ps1)'

But I still doesn't work. How I can get kube-ps1 to work in Warp?

0

There are 0 best solutions below