Merge branch 'pr/newline' of https://github.com/docwhat/powerlevel9k into docwhat-pr/newline

pull/22/head
Ben Hilburn 7 years ago
commit 6486e62f14

@ -143,6 +143,7 @@ The segments that are currently available are:
* [`command_execution_time`](#command_execution_time) - Display the time the current command took to execute. * [`command_execution_time`](#command_execution_time) - Display the time the current command took to execute.
* [`todo`](http://todotxt.com/) - Shows the number of tasks in your todo.txt tasks file. * [`todo`](http://todotxt.com/) - Shows the number of tasks in your todo.txt tasks file.
* `detect_virt` - Virtualization detection with systemd * `detect_virt` - Virtualization detection with systemd
* `newline` - Continues the prompt on a new line.
--------------------------------------------------------------------------------- ---------------------------------------------------------------------------------
@ -442,6 +443,14 @@ segment will not be displayed.
|`POWERLEVEL9K_PUBLIC_IP_METHODS`|(dig curl wget)| These methods in that order are used to refresh your IP.| |`POWERLEVEL9K_PUBLIC_IP_METHODS`|(dig curl wget)| These methods in that order are used to refresh your IP.|
|`POWERLEVEL9K_PUBLIC_IP_NONE`|None|The string displayed when an IP was not obtained| |`POWERLEVEL9K_PUBLIC_IP_NONE`|None|The string displayed when an IP was not obtained|
##### newline
Puts a newline in your prompt so you can continue using segments on the next line.
This allows you to use segments on both lines, unlike `POWERLEVEL9K_PROMPT_ON_NEWLINE`.
This only works on the left side. On the right side it does nothing.
##### rbenv ##### rbenv
This segment shows the version of Ruby being used when using `rbenv` to change your current Ruby stack. This segment shows the version of Ruby being used when using `rbenv` to change your current Ruby stack.

@ -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'

@ -337,6 +337,23 @@ prompt_background_jobs() {
fi fi
} }
# A newline in your prompt, so you can segments on multiple lines.
prompt_newline() {
local lws newline
[[ "$1" == "right" ]] && return
newline=$'\n'
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=
"$1_prompt_segment" \
"$0" \
"$2" \
"NONE" "NONE" "${newline}"
POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS=$lws
}
# Segment that indicates usage level of current partition. # Segment that indicates usage level of current partition.
set_default POWERLEVEL9K_DISK_USAGE_ONLY_WARNING false set_default POWERLEVEL9K_DISK_USAGE_ONLY_WARNING false
set_default POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL 90 set_default POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL 90

Loading…
Cancel
Save