Merge pull request #62 from gregf/sep_line

Add a new option to keep the prompt in two lines or one
This commit is contained in:
Caio Gondim
2015-09-23 22:06:28 +02:00
2 changed files with 9 additions and 1 deletions

View File

@@ -106,6 +106,7 @@ 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_SEP_LINE`|`true`|Make the prompt span across two lines
### Status

View File

@@ -22,6 +22,9 @@ fi
if [ ! -n "${BULLETTRAIN_PROMPT_ROOT+1}" ]; then
BULLETTRAIN_PROMPT_ROOT=true
fi
if [ ! -n "${BULLETTRAIN_PROMPT_SEP_LINE+1}" ]; then
BULLETTRAIN_PROMPT_SEP_LINE=true
fi
# STATUS
if [ ! -n "${BULLETTRAIN_STATUS_SHOW+1}" ]; then
@@ -452,6 +455,10 @@ build_prompt() {
prompt_end
}
PROMPT='
if [[ $BULLETTRAIN_PROMPT_SEP_LINE == 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