3 ms·
This sounds interesting! Can you elaborate further?
by salohcin 3y ago
This sounds interesting! Can you elaborate further?
- misnome 3y agoThe function: if [[ -n ${ZSH_VERSION-} ]]; then # ZSH doesn't split command over multiple variables preexec_custom_history() { echo "$HOSTNAME:\"$PWD\" $$ $(date "+%Y-%m-%dT%H:%M:%S%z") $1" >> "$CUSTOM_HISTORY_FILE" } else preexec_custom_history() { echo "$HOSTNAME:\"$PWD\" $$ $(date "+%Y-%m-%dT%H:%M:%S%z") $*" >> "$CUSTOM_HISTORY_FILE" } fi # Add it to the array of functions to be invoked each time. preexec_functions+=(preexec_custom_history) It's harder to search for multiline but I haven't gotten to fixing that yet. I've thought about putting it into sqlite (pwd makes the file large) but since everything is on network filesystems I don't think that's a place sqlite has any guarantees; screwing up a single line of a bare log doesn't break anything. Edit: The fzf is kind of hacked together but is here: https://pastebin.com/sTxsvZAf https://pastebin.com/sTxsvZAf . It has a few bugs but nothing annoying enough to have made me fix it.