diff --git a/README.md b/README.md index 0960308..52071f6 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,9 @@ with fuzzy searching, you just need to [install ![kubectx interactive search with fzf](img/kubectx-interactive.gif) +If you have `fzf` installed, but want to opt out of using this feature, set the environment variable `KUBECTX_IGNORE_FZF=1`. + + ----- ### Customizing colors diff --git a/kubectx b/kubectx index 5930efd..9d753c9 100755 --- a/kubectx +++ b/kubectx @@ -160,7 +160,7 @@ delete_context() { main() { if [[ "$#" -eq 0 ]]; then - if [[ -t 1 && "$(type fzf &>/dev/null; echo $?)" -eq 0 ]]; then + if [[ -t 1 && -z "${KUBECTX_IGNORE_FZF:-}" && "$(type fzf &>/dev/null; echo $?)" -eq 0 ]]; then choose_context_interactive else list_contexts diff --git a/kubens b/kubens index 3943773..793423d 100755 --- a/kubens +++ b/kubens @@ -157,7 +157,7 @@ swap_namespace() { main() { if [[ "$#" -eq 0 ]]; then - if [[ -t 1 && "$(type fzf &>/dev/null; echo $?)" -eq 0 ]]; then + if [[ -t 1 && -z ${KUBECTX_IGNORE_FZF:-} && "$(type fzf &>/dev/null; echo $?)" -eq 0 ]]; then choose_namespace_interactive else list_namespaces