5 ms·
Slightly silly sketch (bash): sqlite-utils create-table ~/commands.db commands id integer text text --pk id PROMPT_COMMAND="( fc -n -l -1 | perl -p -e
by zwp 4y ago
Slightly silly sketch (bash):
sqlite-utils create-table ~/commands.db commands id integer text text --pk id
PROMPT_COMMAND="( fc -n -l -1 | perl -p -e 's/^\s+//; chomp if eof' | sqlite-utils insert --text ~/commands.db commands - & )"
It's slow, has perl & python external deps, needs a timestamp column, call subshell to avoid job control messages, ...
A nicer single "prompt command" wrapper is certainly possible though.