diff options
| author | Christoph Schlosser <christoph@linux.com> | 2025-06-17 23:04:04 +0200 |
|---|---|---|
| committer | Christoph Schlosser <christoph@linux.com> | 2025-06-17 23:04:04 +0200 |
| commit | ad7b9498811a016c654cf7ad894cc1d079110ec0 (patch) | |
| tree | 7f30e4298c564fe13a30e9f5e1de30381f03743d | |
| parent | 2202078d321f4c80d7ef5e5c12692674e299ed38 (diff) | |
| download | c-star-ad7b9498811a016c654cf7ad894cc1d079110ec0.tar.gz | |
Add command duration
| -rw-r--r-- | conf.d/c_star.fish | 6 | ||||
| -rw-r--r-- | 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 |