Skip to content

Instantly share code, notes, and snippets.

@andrewwippler
Last active June 5, 2018 12:56
Show Gist options
  • Save andrewwippler/ce7ad59b5d0eab0c2f9bc81e07b4ec14 to your computer and use it in GitHub Desktop.
Save andrewwippler/ce7ad59b5d0eab0c2f9bc81e07b4ec14 to your computer and use it in GitHub Desktop.
function _kube_ns() {
KUBE=`kubectl config view --minify --output 'jsonpath={..namespace}'`
if [ ! "${KUBE}" == "default" ]
then
echo "⎈ ${KUBE}"
else
echo ""
fi
}
function custom_prompt() {
PS1="\u@\h \w `_kube_ns` \$ "
}
PROMPT_COMMAND=custom_prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment