Only show right prompt separator when date and cmd duration exist.

See #48
This commit is contained in:
Justin Hileman 2016-06-08 01:17:19 -07:00
parent e39a850ed0
commit fc50e9d6c5

View File

@ -5,22 +5,25 @@ function __bobthefish_cmd_duration -S -d 'Show command duration'
[ "$CMD_DURATION" -lt 100 ]; and return
if [ "$CMD_DURATION" -lt 5000 ]
echo -ns $CMD_DURATION 'ms '
echo -ns $CMD_DURATION 'ms'
else if [ "$CMD_DURATION" -lt 60000 ]
math "scale=1;$CMD_DURATION/1000" | sed 's/\\.0$//'
echo -n 's '
echo -n 's'
else if [ "$CMD_DURATION" -lt 3600000 ]
set_color $fish_color_error
math "scale=1;$CMD_DURATION/60000" | sed 's/\\.0$//'
echo -n 'm '
echo -n 'm'
else
set_color $fish_color_error
math "scale=2;$CMD_DURATION/3600000" | sed 's/\\.0$//'
echo -n 'h '
echo -n 'h'
end
set_color $fish_color_normal
set_color $fish_color_autosuggestion
[ "$theme_display_date" = "no" ]
or echo -ns ' ' $__bobthefish_left_arrow_glyph
end
function __bobthefish_timestamp -S -d 'Show the current timestamp'
@ -28,7 +31,6 @@ function __bobthefish_timestamp -S -d 'Show the current timestamp'
set -q theme_date_format
or set -l theme_date_format "+%c"
echo -n $__bobthefish_left_arrow_glyph
echo -n ' '
date $theme_date_format
end