purs: show user when root

This commit is contained in:
Timothy DeHerrera 2020-07-20 18:45:25 -06:00
parent 364a25a7f2
commit cd44832dc1
No known key found for this signature in database
GPG Key ID: 8985725DB5B0C122
1 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,9 @@
function zle-line-init zle-keymap-select {
PROMPT=`@PURS@/bin/purs prompt -us -k "$KEYMAP" -r "$?" --venv "${${VIRTUAL_ENV:t}%-*}"`
if [[ $USER == root ]]; then
PROMPT=`@PURS@/bin/purs prompt -u -k "$KEYMAP" -r "$?" --venv "${${VIRTUAL_ENV:t}%-*}"`
else
PROMPT=`@PURS@/bin/purs prompt -us -k "$KEYMAP" -r "$?" --venv "${${VIRTUAL_ENV:t}%-*}"`
fi
zle reset-prompt
}
zle -N zle-line-init