3 ms·
You can write full-blown functions for displaying prompts just as easily. prompt_custom() { if (( EUID == 0 )); then printf '# ' else
by soraminazuki 4y ago
You can write full-blown functions for displaying prompts just as easily.
prompt_custom() {
if (( EUID == 0 )); then
printf '# '
else
printf '$ '
fi
}
setopt prompt_subst
PROMPT='$(prompt_custom)'
or more commonly,
prompt_custom_precmd() {
if (( EUID == 0 )); then
PROMPT='# '
else
PROMPT='$ '
fi
}
add-zsh-hook precmd prompt_custom_precmd
I do occasionally check the fish repo for status updates, but decide not to make the switch because of syntax incompatibility concerns and lagging vi keybinding support. Those are issues that I would encounter on a daily basis if I were to use fish.