Fixes to make bash prompt cleaner in more environments
This commit is contained in:
parent
fe76fcea96
commit
2dbb1fa153
10
.bashrc
10
.bashrc
@ -26,10 +26,7 @@ if [[ "${OSTYPE}" == "linux-gnu"* ]]; then
|
|||||||
# append and reload the history after each command
|
# append and reload the history after each command
|
||||||
PROMPT_COMMAND="history -a; history -n"
|
PROMPT_COMMAND="history -a; history -n"
|
||||||
|
|
||||||
for filename in ${HOME}/.ssh/*.pub; do
|
eval $(find "${HOME}/.ssh/" -type f -name "*.pub" | xargs -n 1 keychain --nogui --eval --quiet)
|
||||||
keyname="$(basename ${filename} .pub)"
|
|
||||||
eval $(keychain --nogui --eval --quiet ${keyname})
|
|
||||||
done
|
|
||||||
|
|
||||||
# bind -x '"\C-r"':reset
|
# bind -x '"\C-r"':reset
|
||||||
fi
|
fi
|
||||||
@ -137,6 +134,11 @@ kubectl_context() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
kubectl cluster-info > /dev/null 2>&1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
context=$(kubectl config current-context 2>/dev/null)
|
context=$(kubectl config current-context 2>/dev/null)
|
||||||
namespace=$(kubectl config view -o "jsonpath={.contexts[?(@.name==\"$context\")].context.namespace}")
|
namespace=$(kubectl config view -o "jsonpath={.contexts[?(@.name==\"$context\")].context.namespace}")
|
||||||
cluster=$(kubectl config view -o "jsonpath={.contexts[?(@.name==\"$context\")].context.cluster}")
|
cluster=$(kubectl config view -o "jsonpath={.contexts[?(@.name==\"$context\")].context.cluster}")
|
||||||
|
Loading…
Reference in New Issue
Block a user