diff --git a/.functions/ps1.sh b/.functions/ps1.sh index 5fcdab0..74a09d7 100644 --- a/.functions/ps1.sh +++ b/.functions/ps1.sh @@ -49,7 +49,7 @@ function bash_ps1 () { fi [[ -n "$VIRTUAL_ENV" ]] && PYTHON_ENV="${PS1_COLOR_DIVIDER}─[${PS1_COLOR_VENV}${VIRTUAL_ENV##*/}${PS1_COLOR_DIVIDER}]" if [[ $(type kubectl) ]]; then - CURRENT_CONTEXT="$(kubectl config current-context)" + CURRENT_CONTEXT="$(kubectl config current-context 2>/dev/null)" if [[ "$CURRENT_CONTEXT" != "default" ]];then K8S_CURRENT_CONTEXT="${PS1_COLOR_DIVIDER}[${PS1_COLOR_KUBERNETES}${CURRENT_CONTEXT}${PS1_COLOR_DIVIDER}]" fi @@ -74,7 +74,7 @@ function bash_ps1 () { fi if type -t ssh-add > /dev/null;then - if [[ "$(ssh-add -L | grep -E -c '^ssh')" == "0" ]];then + if [[ "$(ssh-add -L 2>/dev/null | grep -E -c '^ssh')" == "0" ]];then STATUS="${STATUS}${PS1_COLOR_SSH}s" fi fi