summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2018-08-06 01:26:23 +0300
committerDominik Ritter <dritter03@googlemail.com>2018-08-06 01:26:23 +0300
commit3b8f0abdb27fa1628e7016a93805f96d6a215653 (patch)
tree13cea340bccf41846dcd193b7426109e9a9d2c54
parentaca20ae4630e5ba7c1c1226b8c4570239133f06f (diff)
parent7f6ac8dbaca1ff1139a1eb2bef1f234cf4a72099 (diff)
Merge remote-tracking branch 'docwhat/pr/sudo-check' into prepare_066
-rwxr-xr-xpowerlevel9k.zsh-theme4
1 files changed, 2 insertions, 2 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 8a4d5cb6..f253bfb9 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -624,12 +624,12 @@ prompt_context() {
if [[ $(print -P "%#") == '#' ]]; then
current_state="ROOT"
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"
else
current_state="REMOTE"
fi
- elif sudo -n true 2>/dev/null; then
+ elif [[ -n "$SUDO_COMMAND" ]]; then
current_state="SUDO"
fi