Pastebin
Paste #3831: zsh prompt
< previous paste - next paste>
Pasted by tdn
# Red prompt if root, else green
local prompt_color=${(%):-%(!.$fg_bold[red].$fg_bold[green])}
# Overwrite prompt_color to yellow, if we are postgres
#prompt_color=%($(id -u postgres)#.$fg_bold[yellow].$fg_bold[green])
# This next line also handles if postgres user does not exist:
prompt_color=%(${$(id -u postgres):-9999}#.$fg_bold[yellow].$fg_bold[green])
export PROMPT="%{$fg_no_bold[white]%}(%{$prompt_color%}%n@%M%{$fg_no_bold[white]%}) \
(%{$fg_no_bold[$prompt_color]%}%D %D{%T}%{$fg_no_bold[white]%}) (%{$fg_no_bold[green]%}P:%j L:%L%{$fg_no_bold[white]%}) [%?]
%{$fg_bold[white]%}%~ %{$fg_no_bold[white]%}%(!.#.$) "
New Paste
Go to most recent paste.