atuin
atuin copied to clipboard
Excluding commands from being added to history
What is the best way to exclude commands to be added to history?
Using fish I modified _atuin_preexec
like follows
function _atuin_preexec --on-event fish_preexec
if string match -qr '^(cd|mpv|mplayer)' -- $argv
return
end
set -gx ATUIN_HISTORY_ID (atuin history start "$argv[1]")
end
This seems to work.
Question: Is this a good way to do this, or could it be done in a better way?
prefix command with a space
Prefixing a command with a space is only good when I want to exclude a command in certain situations. Not, when I want to exclude a command each time I invoke it.
I think this is a decent idea. For now it could be based just on the program run, but in future we could support full regex syntax for the arguments too.
filter = ["cd", "mpv", "mplayer"]
Thanks for considering to implement this.
Is filter
just an idea for the future or could it be used even now?
Just an idea for now