Add new BULLETTRAIN_PROMPT_ADD_NEWLINE as a option

This commit is contained in:
Greg Fitzgerald
2015-09-24 10:06:45 -04:00
parent 3283a92bf9
commit 14f58f279a
2 changed files with 13 additions and 2 deletions

View File

@@ -107,6 +107,8 @@ or don't want to see. All options must be overridden in your **.zshrc** file.
|`BULLETTRAIN_PROMPT_CHAR`|`\$`|Character to be show before any command
|`BULLETTRAIN_PROMPT_ROOT`|`true`|Highlight if running as root
|`BULLETTRAIN_PROMPT_SEPARATE_LINE`|`true`|Make the prompt span across two lines
|`BULLETTRAIN_PROMPT_ADD_NEWLINE`|`true`|Adds a newline character before each prompt line
### Status

View File

@@ -25,6 +25,9 @@ fi
if [ ! -n "${BULLETTRAIN_PROMPT_SEPARATE_LINE+1}" ]; then
BULLETTRAIN_PROMPT_SEPARATE_LINE=true
fi
if [ ! -n "${BULLETTRAIN_PROMPT_ADD_NEWLINE+1}" ]; then
BULLETTRAIN_PROMPT_ADD_NEWLINE=true
fi
# STATUS
if [ ! -n "${BULLETTRAIN_STATUS_SHOW+1}" ]; then
@@ -455,9 +458,15 @@ build_prompt() {
prompt_end
}
if [[ $BULLETTRAIN_PROMPT_SEPARATE_LINE == true ]] then
PROMPT='%{%f%b%k%}$(build_prompt)
if [[ $BULLETTRAIN_PROMPT_SEPARATE_LINE == true ]]; then
if [[ $BULLETTRAIN_PROMPT_ADD_NEWLINE == true ]]; then
PROMPT='
%{%f%b%k%}$(build_prompt)
%{${fg_bold[default]}%}$(prompt_char) %{$reset_color%}'
else
PROMPT='%{%f%b%k%}$(build_prompt)
%{${fg_bold[default]}%}$(prompt_char) %{$reset_color%}'
fi
else
PROMPT='%{%f%b%k%}$(build_prompt)%{${fg_bold[default]}%} $(prompt_char) %{$reset_color%}'
fi