atuinsh / atuin

✨ Magical shell history
https://atuin.sh
MIT License
20.65k stars 561 forks source link

Feature Request: Add option to specify patterns to be ignored #1942

Open oyarsa opened 6 months ago

oyarsa commented 6 months ago

I don't really want commands like ls, cd, git status and so on to appear when searching the history. It would be good to be able to specify some patterns (globs, regexes, whatever) to filter those out. However, it could be nice to show these if required, so the filtering would be in the UI, not in recording the commands.

This would go along nicely with #1912.

Also, I'd be open to working on this as a PR if I can get some guidance on how to start.

ellie commented 6 months ago

However, it could be nice to show these if required

Have you got an example use case for when you'd want a command like ls to be recorded, but not visible in search without toggling a setting?

I'm a bit unclear on the use here, unless it's for stats?

oyarsa commented 6 months ago

cd would be the motivating example. Most of the time, I don't want it shown in history. But sometimes, when I'm in a complex directory structure with weird names, I'd like to get the latest cd commands I used to go back to where I was previously, especially when filtering only commands from the current directory.

To be fair, I can still get this from history | fzf, and it might not used frequently enough to warrant a feature.