diff --git a/kubectx b/kubectx index f625d75..c80a763 100755 --- a/kubectx +++ b/kubectx @@ -63,7 +63,7 @@ list_contexts() { cur_ctx_bg=${KUBECTX_CURRENT_BGCOLOR:-$darkbg} for c in $(get_contexts); do - if [[ -t 1 && "${c}" = "${cur}" ]]; then + if [[ -t 1 && -z "${NO_COLOR:-}" && "${c}" = "${cur}" ]]; then echo "${cur_ctx_bg}${cur_ctx_fg}${c}${normal}" else echo "${c}" diff --git a/kubens b/kubens index 628181b..6145e94 100755 --- a/kubens +++ b/kubens @@ -117,7 +117,7 @@ list_namespaces() { cur="$(current_namespace)" ns_list=$(get_namespaces) for c in $ns_list; do - if [[ -t 1 && "${c}" = "${cur}" ]]; then + if [[ -t 1 && -z "${NO_COLOR:-}" && "${c}" = "${cur}" ]]; then echo "${cur_ctx_bg}${cur_ctx_fg}${c}${normal}" else echo "${c}"