theme/atomic: update sudo check method

pull/1539/head
David Farrell 2020-03-31 14:02:22 -07:00
parent ca843e7b93
commit d79fc5027b
No known key found for this signature in database
GPG Key ID: 1CCA28D0E300B56F
1 changed files with 1 additions and 1 deletions

View File

@ -194,7 +194,7 @@ ___atomic_prompt_char() {
color=$white
prompt_char="${__ATOMIC_PROMPT_CHAR_PS1}"
if [ "${THEME_SHOW_SUDO}" == "true" ]; then
if [ $(sudo -n id -u 2>&1 | grep 0) ]; then
if sudo -vn 1>/dev/null 2>&1; then
prompt_char="${__ATOMIC_PROMPT_CHAR_PS1_SUDO}"
fi
fi