From e99369a6344e9b3677c872de60637b3457cd5a69 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 24 Oct 2022 02:10:30 +0900 Subject: [PATCH] add: fish: start/exit log to custom history --- dotfiles/fish/config.fish | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dotfiles/fish/config.fish b/dotfiles/fish/config.fish index 76b227c..8bc2ad1 100644 --- a/dotfiles/fish/config.fish +++ b/dotfiles/fish/config.fish @@ -52,6 +52,15 @@ function save_myhistory --on-event fish_prompt -d "Save custom shell log to $my_ echo "$(date '+%Y-%m-%d %H:%M:%S') $hostname:$fish_pid $PWD [$prev_status] $(history -1)" \ >> $my_fish_history end +# starting sign +echo "$(date '+%Y-%m-%d %H:%M:%S') $hostname:$fish_pid [START]" \ + >> $my_fish_history +# exit sign +function save_myhistory_exit --on-event fish_exit -d "Add exit sign to $my_fish_history" + echo "$(date '+%Y-%m-%d %H:%M:%S') $hostname:$fish_pid [EXIT]" \ + >> $my_fish_history +end + # load local patch source ~/.config/fish/local_patch.fish