You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When enabling displaying the kubernetes context on the prompt the terminal really slows down.
I think it's because when displaying the namespace it uses kubectl which seems like a bad idea.
Since you already are reading the kubectl config file I think you could just parse it from there?
Or at least make displaying the namespace optional, now it feels unusable because it lags 2 seconds everytime the prompt line needs to be displayed.
The text was updated successfully, but these errors were encountered:
The hack below uses an external dependency and I'm not really sure how reliable it is but having said that...
I changed my __bobthefish_k8s_namespace function to use yq. The time spent on it reduced significantly.
Before: 36 54179 ---> __bobthefish_k8s_namespace
After 42 15665 ---> __bobthefish_k8s_namespace
function __bobthefish_k8s_namespace -S -d 'Get the current k8s namespace'
yq eval '.contexts[] | select(.name == "'$context'") | .context.namespace' ~/.kube/config
end
And under the __bobthefish_prompt_k8s_context function I'm passing the context:
(...)
[ "$theme_display_k8s_namespace" = 'yes' ]
and set -l namespace (__bobthefish_k8s_namespace $context)
(...)
@garbelini we could add that as an optional dependency, and have it fall back to the slow one? there are several other places we do a manual version of a thing that would otherwise slow everything down (e.g. finding hg project directories)
When enabling displaying the kubernetes context on the prompt the terminal really slows down.
I think it's because when displaying the namespace it uses kubectl which seems like a bad idea.
Since you already are reading the kubectl config file I think you could just parse it from there?
Or at least make displaying the namespace optional, now it feels unusable because it lags 2 seconds everytime the prompt line needs to be displayed.
The text was updated successfully, but these errors were encountered: