1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-19 14:01:57 +00:00

Merge remote-tracking branch 'docwhat/pr/sudo-check' into prepare_066

This commit is contained in:
Dominik Ritter 2018-08-06 00:26:23 +02:00
commit 3b8f0abdb2

View file

@ -624,12 +624,12 @@ prompt_context() {
if [[ $(print -P "%#") == '#' ]]; then if [[ $(print -P "%#") == '#' ]]; then
current_state="ROOT" current_state="ROOT"
elif [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then elif [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then
if sudo -n true 2>/dev/null; then if [[ -n "$SUDO_COMMAND" ]]; then
current_state="REMOTE_SUDO" current_state="REMOTE_SUDO"
else else
current_state="REMOTE" current_state="REMOTE"
fi fi
elif sudo -n true 2>/dev/null; then elif [[ -n "$SUDO_COMMAND" ]]; then
current_state="SUDO" current_state="SUDO"
fi fi