From ad7b9498811a016c654cf7ad894cc1d079110ec0 Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Tue, 17 Jun 2025 23:04:04 +0200 Subject: Add command duration --- conf.d/c_star.fish | 6 +++++- functions/fish_right_prompt.fish | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/conf.d/c_star.fish b/conf.d/c_star.fish index 1bcedb1..bea307c 100644 --- a/conf.d/c_star.fish +++ b/conf.d/c_star.fish @@ -1,6 +1,10 @@ set -q c_star_prompt_symbol || set -g c_star_prompt_symbol ">" set -q c_star_date_format || set -g c_star_date_format "%Y-%m-%dT%H:%M:%S%z" +function c_star_command_time --on-event fish_postexec + set -g c_star_command_time $CMD_DURATION'ms' +end + function c_star_datetime --on-event fish_prompt --on-event fish_postexec --on-variable c_star_date_format set -g c_star_datetime (date "+$c_star_date_format") end @@ -24,7 +28,7 @@ function c_star_user_marker --on-event fish_prompt case "root" set -g c_star_user_marker "$(set_color red)#$(set_color normal)" case '*' - set -g c_star_user_marker "\$" + set -g c_star_user_marker '$' end end diff --git a/functions/fish_right_prompt.fish b/functions/fish_right_prompt.fish index 079a655..34eb6ef 100644 --- a/functions/fish_right_prompt.fish +++ b/functions/fish_right_prompt.fish @@ -1,3 +1,3 @@ function fish_right_prompt --description "The right side of the C-Star prompt" - echo -e "$c_star_datetime" + echo -e "$c_star_command_time $c_star_datetime" end \ No newline at end of file -- cgit v1.2.3