Skip to content

Commit

Permalink
Add (crudely) the last command's duration when over 100ms
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
  • Loading branch information
stephencelis committed Jan 7, 2016
1 parent 5f8ba78 commit 3d315be
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config/fish/functions/fish_prompt.fish
@@ -1,5 +1,15 @@
function fish_prompt --description 'Write out the prompt'

if test "$CMD_DURATION" -gt '100'
set_color $fish_color_error
if test "$CMD_DURATION" -gt '60000'
printf '%.1fm ' (awk "BEGIN { print $CMD_DURATION / 60000 }")
else
printf '%.1fs ' (awk "BEGIN { print $CMD_DURATION / 1000 }")
end
set_color normal
end

set -l last_status $status

if not set -q __fish_prompt_normal
Expand Down

0 comments on commit 3d315be

Please sign in to comment.