When I press CTRL+R and I start searching, my entire history isn’t searched, only the past few days, looks like it’s about 1 week, or maybe a bit more.
How can I configure this lovely tool so that my entire history is searched?
Thank you!
When I press CTRL+R and I start searching, my entire history isn’t searched, only the past few days, looks like it’s about 1 week, or maybe a bit more.
How can I configure this lovely tool so that my entire history is searched?
Thank you!
Which filter_mode
is shown?
“GLOBAL”, looks like.
You did not give a lot of information on your setup.
atuin doctor
might help.atuin search --filter-mode host
and atuin search --filter-mode global
?Ah, sorry. If I run atuin history list --human
I see history going back to 2023, which is what I expect.
I am using Fish.
atuin doctor
gives this output:
"atuin": {
"version": "18.4.0",
"sync": {
"cloud": true,
"records": true,
"auto_sync": true,
"last_sync": "2025-01-17 18:56:17.80415 +00:00:00"
},
"sqlite_version": "3.46.0"
},
"shell": {
"name": "fish",
"default": "fish",
"plugins": [
"atuin"
],
"preexec": "built-in"
},
"system": {
"os": "Darwin",
"arch": "arm64",
"version": "15.2",
"disks": [
{
"name": "Macintosh HD",
"filesystem": "apfs"
},
{
"name": "Macintosh HD",
"filesystem": "apfs"
}
]
}
}
I forgot to answer your second and third question, somehow: yes I imported my shell history, and yes, both filter-modes give the full history I expect to see but do not see when I push CTRL+R.
Oh, wait. You mean you want to scroll down all entries to the beginning of your history?
Nope, the TUI only shows a certain amount of entries (I don’t know the number).
But if you search for it, it will still find the data you are looking for. e.g. search for a command you issued 2023. It will show up in the TUI.
However, if the same command was issued after 2023, the TUI will show the relative timestamp (X ago) for the most recent invocation.
There was a command that I knew I had run in the past, but I had forgotten the syntax. I pressed CTRL+R and typed the executable name and the command and was expecting the times I had run this command in the past to show up. They did not.
Those historical executions were in atuin history list --human
though, so atuin knows about them. They did not show up when I searched after pushing CTRL+R.
I had assumed it was because stuff older than 7-10 days just doesn’t show up when you search with CTRL+R, but you’re saying other things should show up. After checking, you’re right, older stuff does show up, but things that I know are in atuin history list --human
aren’t found. So am I doing something wrong?
atuin history list --human | grep "the command"
finds it. CTRL+R and typing the same command does not.
Depending on the search type (fuzzy, prefix, fulltext), it might not find the command. As I mentioned earlier, if you have run the following commands:
the command
the command
another command
and you search for command
, you will only see
the command
another command
in the TUI.
If your command doesn’t show up, try to use a different seach algo (ctrl+s).
CTRL+S does nothing. Why are there different search algorithms? I just want to search my history. Why is this hard? This should not be hard.
The point of storing your command history in SQLite and then offering a search interface for that database is so that the user can find commands they have run in the past. Atuin is not finding the commands that I have run in the past when I search for them. I kinda wonder what the point is if it can’t find things that are clearly in its database. “What would you say … you do here?”
Unfortunately I can’t tell you why you are unable to find your commands. For that I don’t know the internals of atuin too well.
P.S.:
I can only say that I have been using atuin since the beginning of 2024 and I can search and see the commands that I invoked in the beginning in the TUI.
I rather meant the command might not be at the top of the result list.
we’ve found that a bunch of people have very strong preferences on search
In order to accommodate these preferences, we introduced different search modes. In your case I’d suggest
smart_sort
- this will be enabled by default in a future release, and will enable better sorted. You may prefer it.smart_sort = true
in your config file (~/.config/atuin/config.toml
)
Otherwise, the alternative search modes are documented here: Config | Atuin Docs
I’ve set that, and I can see that search results are different, but I’m not sure I’m making myself clear.
I know I’ve run tart create
in the past, many times. atuin history list | grep "tart create"
finds every one of them. Pushing CTRL+R and then typing tart create
finds 1 instance of this command, the most recent one, and a whole pile of other commands that i’ve run which have neither “tart” nor “create” in the command at all. Presumably some subset of the letters of “tart create” is being found.
What I’m trying to say is that it’s not a sorting problem. The results I expect simply aren’t there at all.
I would not have started this thread if the other instances of tart create
showed up in the search results anywhere. They just don’t show up, and I know that atuin is aware of these because they DO show up when I run atuin history list
.
So, to reiterate: commands that I know exist in history are not being found when i type the first two words of the command, verbatim, in search. Is that normal?
This is a side effect of fuzzy search, which tries to find commands that contain the query, and sorts them by how similar they are. Smart sort tries to make this better. It aims to account for typos, etc.
Could you please try the prefix search mode and tell me if this still happens? It literally just searches for your query as the first part of the command.
The different search modes are literally completely different search algorithms, which behave differently, and are far more than just sorting.
No, it’s not normal
ah, success; thank you.
After reading the docs on search modes, I don’t think prefix
is what I’m after, but fulltext
, which I have now set. And after pushing CTRL+R and typing tart create
I see what I expect to see.
I had assumed that fuzzy search would first show results which were less fuzzy before it showed results which were more fuzzy, but that doesn’t appear to be the case, or I simply don’t understand fuzzy searching at all (the much more likely cause of my problem.)
Thank you for sticking with me and helping.