matchai / spacefish

🚀🐟 The fish shell prompt for astronauts
https://spacefish.matchai.dev
MIT License
963 stars 79 forks source link

Hide kubecontext outside of kube project #122

Closed matchai closed 5 years ago

matchai commented 5 years ago

Description

Add an early return when kube_context is not present.

Motivation and Context

Closes #111

Types of changes

Screenshots (if appropriate):

How Has This Been Tested?

Checklist:

Snuggle commented 5 years ago

The indentation on this line has gone swimming! Looks good otherwise, please fix before merging. :blush:

https://github.com/matchai/spacefish/blob/0b888b0a2bdae470ece1dd838163a4a22b054fb9/functions/__sf_section_kubecontext.fish#L15

MindTooth commented 5 years ago

Did you notice any changes in rendering speed of the prompt? Felt like this (kubectl)-check caused the shell to halt some before render det new input line.

Testing without Spacefish and using a built in prompt, and it flies away.

Any way for me to completely disable the Kubernetes section, to test the speed out?

matchai commented 5 years ago

This most-recent update should not really affect performance as it's only checking the existence of a variable. We were already performing the kubectl check previously, but not acting on it. 😅

Yes, by setting SPACEFISH_KUBECONTEXT_SHOW to false, the section won't appear, skipping the check.

You can add set -gx SPACEFISH_KUBECONTEXT_SHOW false to your config.fish to disable it.

MindTooth commented 5 years ago

Guess it's all the different checks then. :smile:

Thanks.