Merge pull request #1539 from davidpfarrell/plugins/atomic/sudo

theme/atomic: Update sudo check method
This commit is contained in:
Nils Winkler
2020-04-01 10:01:47 +02:00
committed by GitHub

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