Короткое имя пользователя в prompt

This commit is contained in:
Дмитрий Рамазанов 2019-08-30 08:34:37 +00:00
parent 05661718f2
commit d031a79117

10
.zshrc
View File

@ -73,7 +73,15 @@ zle -N down-line-or-beginning-search
#prompt redhat
autoload -U colors && colors
PROMPT="%B%F{2}[%n@%m %~]%#%f%b "
apos=`expr index "$USER" @`
if [[ $apos -ne '0' ]]; then
U=${USER:0:$apos}
PROMPT="%B%F{2}[$U%m %~]%#%f%b "
else
PROMPT="%B%F{2}[%n@%m %~]%#%f%b "
fi
#RPROMPT='%T'
# Extract archives