mirror of
https://github.com/atuinsh/atuin.git
synced 2026-10-24 09:15:28 +02:00
Fixes #3857. In the shell init scripts, tell the daemon to build the search index so it's ready by the time the user executes the first query. The daemon currently builds the index when it starts, but if a user has `search.shells = "auto"` in config.toml (the default), the daemon can't always know which shell the user is actually going to be using, and thus can't build the correct index. The init script provided by `atuin init`, however, knows exactly which shell is in use, and thus can signal the daemon to build the correct index. ### Implementation details This PR adds a new hidden command, `atuin __internal prepare-search-index`. If the user has selected the daemon-fuzzy engine, this command will send a new gRPC message, `PrepareIndexRequest`, to the daemon. The call to `atuin __internal prepare-search-index` is executed as a background job in the shell init scripts to avoid blocking the shell, and with stdout/stderr silenced.