diff options
-rw-r--r-- | prompt_adam3_setup | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/prompt_adam3_setup b/prompt_adam3_setup index 10fd35e..927955a 100644 --- a/prompt_adam3_setup +++ b/prompt_adam3_setup @@ -54,7 +54,7 @@ prompt_adam3_setup () { prompt_adam3_precmd () { # setopt noxtrace localoptions local base_prompt_expanded_no_color base_prompt_etc - local prompt_length space_left + local prompt_length space_left promptchar base_prompt_expanded_no_color=$(print -P "$base_prompt_no_color") base_prompt_etc=$(print -P "$base_prompt%(4~|...|)%3~") @@ -68,7 +68,12 @@ prompt_adam3_precmd () { space_left=$(( $COLUMNS - $#base_prompt_expanded_no_color - 2 )) path_prompt="%B%F{$prompt_adam3_color4}%${space_left}<...<%~$prompt_newline%F{white}" fi - PS1="$base_prompt$path_prompt %# $post_prompt" + + # make promptchar bold red if root + if [[ $EUID == 0 ]]; then promptchar="%F{red}%B%#%b%f"; else promptchar="%#"; fi + + + PS1="$base_prompt$path_prompt $promptchar $post_prompt" PS2="$base_prompt$path_prompt %_> $post_prompt" PS3="$base_prompt$path_prompt ?# $post_prompt" } |