From a4aad67bd377f6515baddcb1db03a19ec8166bbe Mon Sep 17 00:00:00 2001 From: Rogue-King Date: Mon, 25 Nov 2024 20:39:47 -0800 Subject: [PATCH] removed cost function --- passion.zsh-theme | 76 +++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/passion.zsh-theme b/passion.zsh-theme index 00d789b..581c67d 100644 --- a/passion.zsh-theme +++ b/passion.zsh-theme @@ -120,51 +120,51 @@ output_command_execute_after() { local color_time="$fg_no_bold[cyan]"; time="${color_time}${time}${color_reset}"; - # cost - local time_end="$(current_time_millis)"; - local cost=$(bc -l <<<"${time_end}-${COMMAND_TIME_BEGIN}"); - COMMAND_TIME_BEGIN="-20200325" - local length_cost=${#cost}; - if [ "$length_cost" = "4" ]; - then - cost="0${cost}" - fi - cost="[cost ${cost}s]" - local color_cost="$fg_no_bold[cyan]"; - cost="${color_cost}${cost}${color_reset}"; + # # cost + # local time_end="$(current_time_millis)"; + # local cost=$(bc -l <<<"${time_end}-${COMMAND_TIME_BEGIN}"); + # COMMAND_TIME_BEGIN="-20200325" + # local length_cost=${#cost}; + # if [ "$length_cost" = "4" ]; + # then + # cost="0${cost}" + # fi + # cost="[cost ${cost}s]" + # local color_cost="$fg_no_bold[cyan]"; + # cost="${color_cost}${cost}${color_reset}"; - echo -e "${time} ${cost} ${cmd}"; - echo -e ""; + # echo -e "${time} ${cost} ${cmd}"; + # echo -e ""; } # command execute before # REF: http://zsh.sourceforge.net/Doc/Release/Functions.html -preexec() { # cspell:disable-line - COMMAND_TIME_BEGIN="$(current_time_millis)"; -} +# preexec() { # cspell:disable-line +# COMMAND_TIME_BEGIN="$(current_time_millis)"; +# } -current_time_millis() { - local time_millis; - if [[ "$OSTYPE" == "linux-gnu" ]]; then - # Linux - time_millis="$(date +%s.%3N)"; - elif [[ "$OSTYPE" == "darwin"* ]]; then - # macOS - time_millis="$(gdate +%s.%3N)"; - elif [[ "$OSTYPE" == "cygwin" ]]; then - # POSIX compatibility layer and Linux environment emulation for Windows - elif [[ "$OSTYPE" == "msys" ]]; then - # Lightweight shell and GNU utilities compiled for Windows (part of MinGW) - elif [[ "$OSTYPE" == "win32" ]]; then - # I'm not sure this can happen. - elif [[ "$OSTYPE" == "freebsd"* ]]; then - # ... - else - # Unknown. - fi - echo $time_millis; -} +# current_time_millis() { +# local time_millis; +# if [[ "$OSTYPE" == "linux-gnu" ]]; then +# # Linux +# time_millis="$(date +%s.%3N)"; +# elif [[ "$OSTYPE" == "darwin"* ]]; then +# # macOS +# time_millis="$(gdate +%s.%3N)"; +# elif [[ "$OSTYPE" == "cygwin" ]]; then +# # POSIX compatibility layer and Linux environment emulation for Windows +# elif [[ "$OSTYPE" == "msys" ]]; then +# # Lightweight shell and GNU utilities compiled for Windows (part of MinGW) +# elif [[ "$OSTYPE" == "win32" ]]; then +# # I'm not sure this can happen. +# elif [[ "$OSTYPE" == "freebsd"* ]]; then +# # ... +# else +# # Unknown. +# fi +# echo $time_millis; +# } # command execute after