mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-12 19:18:28 +02:00
change sudo detection method
This commit is contained in:
parent
7b8656f8e7
commit
06802647a1
@ -609,7 +609,7 @@ prompt_context() {
|
|||||||
current_state="ROOT"
|
current_state="ROOT"
|
||||||
elif [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then
|
elif [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then
|
||||||
current_state="REMOTE"
|
current_state="REMOTE"
|
||||||
elif sudo -n uptime >/dev/null 2>&1; then
|
elif sudo -n true 2>/dev/null; then
|
||||||
current_statue="SUDO"
|
current_statue="SUDO"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -632,7 +632,7 @@ prompt_user() {
|
|||||||
"FOREGROUND_COLOR" "yellow"
|
"FOREGROUND_COLOR" "yellow"
|
||||||
"VISUAL_IDENTIFIER" "ROOT_ICON"
|
"VISUAL_IDENTIFIER" "ROOT_ICON"
|
||||||
)
|
)
|
||||||
elif sudo -n uptime >/dev/null 2>&1; then
|
elif sudo -n true 2>/dev/null; then
|
||||||
user_state=(
|
user_state=(
|
||||||
"STATE" "SUDO"
|
"STATE" "SUDO"
|
||||||
"CONTENT" "${POWERLEVEL9K_USER_TEMPLATE}"
|
"CONTENT" "${POWERLEVEL9K_USER_TEMPLATE}"
|
||||||
|
Loading…
Reference in New Issue
Block a user