Save your local shell history to log files
justinjoyce.dev
justinjoyce.dev
nevermind, managed to get this working for fish, just add it to the end of your ~/.config/fish/config.fish file :)
# log every command
function cmd_log --on-event fish_preexec
if test (id -u) -ne 0 # if we're already sudo, don't log
echo $(date "+%Y-%m-%d.%H:%M:%S"): $(pwd): $argv >> ~/.logs/cmd-history-$(date "+%Y-%m-%d").log
end
end
And, since I keep editing this comment... blog post about it with all credit to OP and OP's inspiration