diff --git a/conf.d/wakatime.fish b/conf.d/wakatime.fish index ba86190..264fc9b 100644 --- a/conf.d/wakatime.fish +++ b/conf.d/wakatime.fish @@ -5,13 +5,21 @@ # see: https://github.com/ik11235/wakatime.fish ### -function __register_wakatime_fish_before_exec -e fish_preexec +function __register_wakatime_fish_before_exec -e fish_postexec if set -q FISH_WAKATIME_DISABLED return 0 end + + set -l exec_command_str + + set exec_command_str (echo $argv | cut -d ' ' -f1) + + if test "$exec_command_str" = 'exit' + return 0 + end set -l PLUGIN_NAME "ik11235/wakatime.fish" - set -l PLUGIN_VERSION "0.0.3" + set -l PLUGIN_VERSION "0.0.4" set -l project set -l wakatime_path @@ -31,5 +39,5 @@ function __register_wakatime_fish_before_exec -e fish_preexec set project "Terminal" end - $wakatime_path --write --plugin "$PLUGIN_NAME/$PLUGIN_VERSION" --entity-type app --project "$project" --entity (echo $history[1] | cut -d ' ' -f1) &> /dev/null& + $wakatime_path --write --plugin "$PLUGIN_NAME/$PLUGIN_VERSION" --entity-type app --project "$project" --entity "$exec_command_str" &> /dev/null& end