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

Add fzf support for interactive search #71

Closed
ahmetb opened this issue Aug 17, 2018 · 4 comments

Comments

@ahmetb
Copy link
Owner

commented Aug 17, 2018

We can optionally support fzf if it is in the PATH to provide interactive context selecting with partial/fuzzy input!

it would work like:

if len(args) == 1 && output is tty && fzf in path:
    # interactive mode
    choice="$(FZF_DEFAULT_COMMAND=kubectx NO_COLOR=1 fzf)"
	set_context $choice
else:
    # non-interactive mode (list contexts and exit)
    list_contexts
end

Anyone like this?

@ahmetb

This comment has been minimized.

Copy link
Owner Author

commented Aug 17, 2018

if anyone's interested, check out branch https://github.com/ahmetb/kubectx/tree/fzf-support

@ahmetb ahmetb closed this in #74 Aug 22, 2018

ahmetb added a commit that referenced this issue Aug 22, 2018
add support for interactive selection with fzf (#74)
Present a fuzzy search choice in "kubectx" and "kubens" commands without
arguments.

![demo2](https://user-images.githubusercontent.com/159209/44478683-40f16d00-a5f3-11e8-99e2-f32f2a3539c1.gif)

Fixes #71.

@ahmetb ahmetb added this to the v0.6.0 milestone Aug 22, 2018

ahmetb added a commit that referenced this issue Aug 23, 2018
Release v0.6.0
- FEATURE: interactive search mode when kubectx and kubens are ran without any
  arguments and fzf(1) is detected in PATH. (#71, #74)
- FIX: kubectx -d now doesn't ignore arguments after the first argument. (#75)
- FIX: empty output bug when TERM=vt100 even though NO_COLOR is set. (#57, #73)
- FIX: --help exits with code 0 now. (#69, #72)
@gowtham-sai

This comment has been minimized.

Copy link

commented Mar 8, 2019

How do I see current context with this? Whenever I type kubectx it opens up fzf :(

@ahmetb

This comment has been minimized.

Copy link
Owner Author

commented Mar 8, 2019

  1. Fzf shows current context with yellow color.
  2. There’s a way to disable fzf in the readme.
  3. See #125.
  4. Please open new issues to ask questions. Closed issues aren’t good for this.
@gowtham-sai

This comment has been minimized.

Copy link

commented Mar 8, 2019

Extreme apologies..! Directly landed on the issue page and didn't check README. I have another issue with it, will create new issue.

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.