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

Can we add kubernetes integration? #101

Open
mosheavni opened this issue Dec 3, 2020 · 3 comments
Open

Can we add kubernetes integration? #101

mosheavni opened this issue Dec 3, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@mosheavni
Copy link

Is your feature request related to a problem? Please describe.
No, just a feature to display the kubernetes cluster I'm in + the namespace

Describe the solution you'd like
To display the kubernetes cluster I'm in + the namespace

Describe alternatives you've considered
If it would be possible to add my custom functions that could also work.

@reobin
Copy link
Owner

reobin commented Dec 4, 2020

Hey @MosheM123 !

What would your function look like?

I really like the option of letting a user add a prefix to the left prompt that could be a function or simply text, so we might go with that.

@reobin reobin added the enhancement New feature or request label Dec 4, 2020
@mosheavni
Copy link
Author

Here's what I want to add:
https://github.com/jonmosco/kube-ps1

@itay-grudev
Copy link

@mosheavni Here is my solution to the problem:

image

k8s_current_context() {
  echo "[k8s:$(kubectl config current-context | awk -F'/' '{print $2}')]";
}

export TYPEWRITTEN_RIGHT_PROMPT_PREFIX_FUNCTION=k8s_current_context
export TYPEWRITTEN_COLORS="right_prompt_prefix:#FF80BF"

Specifically you may need to tailor any post processing of the current context, which in my case I achieve with: awk -F'/' '{print $2}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants