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

Show visual indication of the selected namespace and context #107

Closed
wants to merge 2 commits into from

Conversation

FabioAntunes
Copy link

@FabioAntunes FabioAntunes commented Dec 22, 2018

When using kubens with fzf there's no visual indication of the selected namespace and context.
That's because fzf is considered a non-interactive tty, so there's no colour on the output.

This PR aims to fix that by creating a specific flag, that gets set every time we call kubens with fzf.

Fixes #98 and #89

@googlebot
Copy link
Collaborator

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@FabioAntunes
Copy link
Author

I signed it!

@googlebot
Copy link
Collaborator

CLAs look good, thanks!

@FabioAntunes FabioAntunes changed the title Show visual indication of the selected namespace Show visual indication of the selected namespace and context Dec 22, 2018
When using `kubens` with `fzf` there's no visual indication of the selected namespace.
That's becuase fzf is considered a non-interactive tty, so there's no color on the output.

This PR aims to fix that by creating a specific flag, that gets set every time we call kubens with fzf
@ahmetb
Copy link
Owner

ahmetb commented Dec 22, 2018

I'm currently -1 for introducing yet another variable, some reasons:

  • becomes yet another knob that takes effect only when fzf exists
  • variable contains fzf (this was my bad, I have an existing variable like this) apparently other programs that do the same (e.g. fzy) exist too, so we need a generic name
  • variable currently named KUBENS_ ideally it should be KUBECTX_

Simplest (but hacky) way I'm imagining we can solve this:

  1. Force sending colors to fzf
  2. fzf will show the colors
  3. when user chooses an option, we'll get value with color sequences in it
  4. strip off color sequences and use.

thoughts?

@ahmetb
Copy link
Owner

ahmetb commented Dec 22, 2018

Please review #109. The if logic there is a bit different than yours, I wanna make sure we get it right.

@ahmetb ahmetb closed this Dec 29, 2018
@FabioAntunes FabioAntunes deleted the patch-1 branch January 6, 2019 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Current cluster not highlighted in interactive mode
4 participants