From 00a1e12bfbd5e91105579e5e34dbec0dc52b2763 Mon Sep 17 00:00:00 2001 From: Oliver Ford Date: Fri, 11 Oct 2019 17:14:32 +0100 Subject: [PATCH] Disable preview when fuzzy-finding (#163) The user may have global settings that enable the preview pane in fzf. Whatever the preview command is set as, it probably doesn't render anything meaningful for kubens - I can't think what would be. For kubectx, the context yaml itself would _maybe_ be helpful, but it likely contains secrets, so I don't personally think I'd find it useful enough to get into. This commit thus disables the preview, so that if the user did have it enabled, there's now no pane where there would previously have probably been an error, such as: [bat error]: '': No such file or directory (os error 2) --- kubectx | 2 +- kubens | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kubectx b/kubectx index b168a9c..802d1bd 100755 --- a/kubectx +++ b/kubectx @@ -107,7 +107,7 @@ choose_context_interactive() { local choice choice="$(_KUBECTX_FORCE_COLOR=1 \ FZF_DEFAULT_COMMAND="${SELF_CMD}" \ - fzf --ansi || true)" + fzf --ansi --no-preview || true)" if [[ -z "${choice}" ]]; then echo 2>&1 "error: you did not choose any of the options" exit 1 diff --git a/kubens b/kubens index c010122..64d6460 100755 --- a/kubens +++ b/kubens @@ -109,7 +109,7 @@ choose_namespace_interactive() { local choice choice="$(_KUBECTX_FORCE_COLOR=1 \ FZF_DEFAULT_COMMAND="${SELF_CMD}" \ - fzf --ansi || true)" + fzf --ansi --no-preview || true)" if [[ -z "${choice}" ]]; then echo 2>&1 "error: you did not choose any of the options" exit 1