fix: fish: exit status logging of my custom history file
This commit is contained in:
parent
d949be12c6
commit
d68e0833db
1 changed files with 2 additions and 1 deletions
|
@ -26,7 +26,8 @@ bind \b backward-kill-word
|
||||||
# save fish log to my custom file
|
# save fish log to my custom file
|
||||||
set -gx my_fish_history "$HOME/my_fish_history.txt"
|
set -gx my_fish_history "$HOME/my_fish_history.txt"
|
||||||
function save_myhistory --on-event fish_prompt -d "Save custom shell log to $my_fish_history"
|
function save_myhistory --on-event fish_prompt -d "Save custom shell log to $my_fish_history"
|
||||||
echo "$(date '+%Y-%m-%d %H:%M:%S') $hostname:$fish_pid $PWD [$status] $(history -1)" \
|
set -l prev_status $status
|
||||||
|
echo "$(date '+%Y-%m-%d %H:%M:%S') $hostname:$fish_pid $PWD [$prev_status] $(history -1)" \
|
||||||
>> $my_fish_history
|
>> $my_fish_history
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue