1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-14 00:50:08 +00:00

newline: support PROMPT_ON_NEWLINE

The newline segment will now show ├─ when using
`POWERLEVEL9K_PROMPT_ON_NEWLINE`

Note: This can be overridden via `POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX`
This commit is contained in:
Christian Höltje 2017-05-12 21:07:50 -04:00
parent 161c995625
commit e9e3e9dc53
2 changed files with 14 additions and 6 deletions

View file

@ -39,8 +39,9 @@ case $POWERLEVEL9K_MODE in
FAIL_ICON $'\u2718' # ✘ FAIL_ICON $'\u2718' # ✘
SYMFONY_ICON 'SF' SYMFONY_ICON 'SF'
NODE_ICON $'\u2B22' # ⬢ NODE_ICON $'\u2B22' # ⬢
MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─
MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # ├─
MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─
APPLE_ICON $'\uE26E' #  APPLE_ICON $'\uE26E' # 
WINDOWS_ICON $'\uE26F' #  WINDOWS_ICON $'\uE26F' # 
FREEBSD_ICON $'\U1F608 ' # 😈 FREEBSD_ICON $'\U1F608 ' # 😈
@ -111,6 +112,7 @@ case $POWERLEVEL9K_MODE in
SYMFONY_ICON 'SF' SYMFONY_ICON 'SF'
NODE_ICON $'\u2B22' # ⬢ NODE_ICON $'\u2B22' # ⬢
MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─ MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─
MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # ├─
MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─ MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─
APPLE_ICON $'\uF179' #  APPLE_ICON $'\uF179' # 
WINDOWS_ICON $'\uF17A' #  WINDOWS_ICON $'\uF17A' # 
@ -178,6 +180,7 @@ case $POWERLEVEL9K_MODE in
SYMFONY_ICON $'\uE757' #  SYMFONY_ICON $'\uE757' # 
NODE_ICON $'\uE617 ' #  NODE_ICON $'\uE617 ' # 
MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─ MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─
MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # ├─
MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─ MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─
APPLE_ICON $'\uF179' #  APPLE_ICON $'\uF179' # 
WINDOWS_ICON $'\uF17A' #  WINDOWS_ICON $'\uF17A' # 
@ -244,8 +247,9 @@ case $POWERLEVEL9K_MODE in
FAIL_ICON $'\u2718' # ✘ FAIL_ICON $'\u2718' # ✘
SYMFONY_ICON 'SF' SYMFONY_ICON 'SF'
NODE_ICON $'\u2B22' # ⬢ NODE_ICON $'\u2B22' # ⬢
MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\u2500' MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─
MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\u2500 ' MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # ├─
MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─
APPLE_ICON 'OSX' APPLE_ICON 'OSX'
WINDOWS_ICON 'WIN' WINDOWS_ICON 'WIN'
FREEBSD_ICON 'BSD' FREEBSD_ICON 'BSD'

View file

@ -339,14 +339,18 @@ prompt_background_jobs() {
# A newline in your prompt, so you can segments on multiple lines. # A newline in your prompt, so you can segments on multiple lines.
prompt_newline() { prompt_newline() {
local lws local lws newline
[[ "$1" == "right" ]] && return [[ "$1" == "right" ]] && return
newline=$'\n'
lws=$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS lws=$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS
if [[ "$POWERLEVEL9K_PROMPT_ON_NEWLINE" == true ]]; then
newline="${newline}$(print_icon 'MULTILINE_NEWLINE_PROMPT_PREFIX')"
fi
POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS= POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS=
"$1_prompt_segment" \ "$1_prompt_segment" \
"$0" \ "$0" \
"$2" \ "$2" \
"NONE" "NONE" $'\n' "NONE" "NONE" "${newline}"
POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS=$lws POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS=$lws
} }