Understanding atuin history search

Thanks for bringing this up! It’s currently sorting by minspan, which can sometimes feel wrong depending on the query. I’ve been wanting to improve on it for a while, but doing so without regressions, including performance impact is harder than I’d like.

It’ll probably be because

curl http://shop-data-s-4vcpu-16gb-320gb-intel-nyc3-0b

isn’t actually that bad by that scoring, but obviously looks wrong to a user. We’re not doing any tokenisation either, so cannot prioritise terms properly, which makes that harder.

First, our minspan sorting is here;

We’ve also experimented with Skim (similar to fzf, but usable as a library). The issue there is that the startup time is noticeable to users, as we need to read and index all shell history (same issues with atuin list | fzf)

I’d like to make some changes really, but doing so without a set of examples of what most people think feels good is tricky. There’s an initial attempt at that hiding behind

smart_sort = true

In config. Implementation here:

It’ll basically prefer newer commands, and commands that more literally contain the query. If you give it a go and lmk how it works for you, that would be great!

The other limitations are because we’re trying to approximate fzf in sql, which doesn’t work as well as I’d like (implementation here)

Otherwise, some other search modes may feel better to you: Config | Atuin Docs

Maybe more detail than you wanted, but I’m very happy to discuss further

2 Likes