mirror of
https://github.com/oh-my-fish/theme-bobthefish.git
synced 2024-10-27 20:34:23 +00:00
Only show right prompt separator when date and cmd duration exist.
See #48
This commit is contained in:
parent
e39a850ed0
commit
fc50e9d6c5
@ -5,22 +5,25 @@ function __bobthefish_cmd_duration -S -d 'Show command duration'
|
|||||||
[ "$CMD_DURATION" -lt 100 ]; and return
|
[ "$CMD_DURATION" -lt 100 ]; and return
|
||||||
|
|
||||||
if [ "$CMD_DURATION" -lt 5000 ]
|
if [ "$CMD_DURATION" -lt 5000 ]
|
||||||
echo -ns $CMD_DURATION 'ms '
|
echo -ns $CMD_DURATION 'ms'
|
||||||
else if [ "$CMD_DURATION" -lt 60000 ]
|
else if [ "$CMD_DURATION" -lt 60000 ]
|
||||||
math "scale=1;$CMD_DURATION/1000" | sed 's/\\.0$//'
|
math "scale=1;$CMD_DURATION/1000" | sed 's/\\.0$//'
|
||||||
echo -n 's '
|
echo -n 's'
|
||||||
else if [ "$CMD_DURATION" -lt 3600000 ]
|
else if [ "$CMD_DURATION" -lt 3600000 ]
|
||||||
set_color $fish_color_error
|
set_color $fish_color_error
|
||||||
math "scale=1;$CMD_DURATION/60000" | sed 's/\\.0$//'
|
math "scale=1;$CMD_DURATION/60000" | sed 's/\\.0$//'
|
||||||
echo -n 'm '
|
echo -n 'm'
|
||||||
else
|
else
|
||||||
set_color $fish_color_error
|
set_color $fish_color_error
|
||||||
math "scale=2;$CMD_DURATION/3600000" | sed 's/\\.0$//'
|
math "scale=2;$CMD_DURATION/3600000" | sed 's/\\.0$//'
|
||||||
echo -n 'h '
|
echo -n 'h'
|
||||||
end
|
end
|
||||||
|
|
||||||
set_color $fish_color_normal
|
set_color $fish_color_normal
|
||||||
set_color $fish_color_autosuggestion
|
set_color $fish_color_autosuggestion
|
||||||
|
|
||||||
|
[ "$theme_display_date" = "no" ]
|
||||||
|
or echo -ns ' ' $__bobthefish_left_arrow_glyph
|
||||||
end
|
end
|
||||||
|
|
||||||
function __bobthefish_timestamp -S -d 'Show the current timestamp'
|
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
|
set -q theme_date_format
|
||||||
or set -l theme_date_format "+%c"
|
or set -l theme_date_format "+%c"
|
||||||
|
|
||||||
echo -n $__bobthefish_left_arrow_glyph
|
|
||||||
echo -n ' '
|
echo -n ' '
|
||||||
date $theme_date_format
|
date $theme_date_format
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user