mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-02 19:32:43 +00:00
fix(atuin): use the packaged binary only
~/.atuin/bin held an old standalone atuin (18.19.0) that the shells prepended to PATH, shadowing pacman's /usr/bin/atuin (18.21.0). The daemon runs the packaged binary and migrated the history DB, so every shell command through the old one failed with "migration 20260818000000 was previously applied but is missing in the resolved migrations". Drop conf.d/atuin.env.fish, the `. ~/.atuin/bin/env` lines in .bashrc and .zshrc (atuin init is now guarded on `command -v atuin`), the cargo-dist receipt, and atuin-pick's ~/.atuin/bin fallback. Also drop `atuin ai init fish`, which 18.21 removed; config.fish already carries the `?` binding it emitted.
This commit is contained in:
1 parent
2049f580f0
commit
c3828a747c
10 files changed
+23
-45
No files matched your search
+7
-26
@@ -9,38 +9,22 @@ description: Shell history search with a daemon, directory-scoped up-arrow, tmux
|
||||
| --- | --- | --- |
|
||||
| `dot_config/atuin/private_config.toml` | `~/.config/atuin/config.toml` | `private_`: written as a regular `0600` file, not a symlink |
|
||||
| `dot_config/atuin/themes/cyberdream.toml` | `~/.config/atuin/themes/cyberdream.toml` | symlink |
|
||||
| `dot_config/atuin/atuin-receipt.json` | `~/.config/atuin/atuin-receipt.json` | symlink |
|
||||
|
||||
chezmoi runs in symlink mode, but `private_` files are written as real files, so edits to `~/.config/atuin/config.toml` do not reach the repo on their own. Copy them back with `chezmoi re-add` (or `czs`, see [fish](/shell/fish#functions)). None of the files are templates, and they apply on every role.
|
||||
|
||||
## Installation
|
||||
|
||||
`atuin` is listed in `.chezmoidata/packages.yaml` for pacman and Homebrew. The shells also expect atuin's standalone installer layout in `~/.atuin/bin`:
|
||||
`atuin` is listed in `.chezmoidata/packages.yaml` for pacman and Homebrew, and the shells use that package's binary (`/usr/bin/atuin` on Arch). Each shell runs `atuin init` only if `atuin` is on `PATH`.
|
||||
|
||||
- fish: `conf.d/atuin.env.fish` sources `~/.atuin/bin/env.fish`.
|
||||
- bash and zsh: `. "$HOME/.atuin/bin/env"` just before `atuin init`.
|
||||
|
||||
Neither line checks that the file exists, so a machine without `~/.atuin/bin` prints a sourcing error at shell start.
|
||||
|
||||
### atuin-receipt.json
|
||||
|
||||
The receipt that atuin's [cargo-dist](https://opensource.axo.dev/cargo-dist/) installer writes. It records how atuin was installed, which the self-updater (`atuin update`) needs:
|
||||
|
||||
| Field | Value |
|
||||
| --- | --- |
|
||||
| `binaries` | `["atuin"]` |
|
||||
| `install_prefix` | `~/.atuin/bin` (stored as an absolute path under `/home/prad`) |
|
||||
| `install_layout` | `flat` |
|
||||
| `modify_path` | `true` |
|
||||
| `provider` | cargo-dist `0.31.0` |
|
||||
| `source` | GitHub release `atuinsh/atuin` |
|
||||
| `version` | `18.19.0` |
|
||||
:::note[No standalone install]
|
||||
An earlier setup also kept atuin's standalone installer layout in `~/.atuin/bin` (with a cargo-dist `atuin-receipt.json` in the repo) and prepended it to `PATH` from `conf.d/atuin.env.fish` and `. "$HOME/.atuin/bin/env"` in `.bashrc`/`.zshrc`. That copy fell behind the package: the daemon, from the newer package, migrated the history database, and every command the shells ran through the old binary failed with `migration 20260818000000 was previously applied but is missing in the resolved migrations`. The standalone install, its receipt, and the `PATH` lines are gone. Do not reinstall atuin with its curl installer on this setup.
|
||||
:::
|
||||
|
||||
## Shell integration
|
||||
|
||||
| Shell | Where | What |
|
||||
| --- | --- | --- |
|
||||
| fish | `config.fish`, interactive only | `atuin init fish \| source`, `atuin ai init fish \| source`, and the `?` binding |
|
||||
| fish | `config.fish`, interactive only | `atuin init fish \| source`, and a copy of the `?` binding (atuin 18.21 removed the `atuin ai init` command that used to emit it) |
|
||||
| fish | `functions/fish_user_key_bindings.fish` | <kbd>ctrl-w</kbd> runs `atuin ai inline` |
|
||||
| bash | end of `~/.bashrc` | `eval "$(atuin init bash)"` |
|
||||
| zsh | end of `~/.zshrc` | `eval "$(atuin init zsh)"` |
|
||||
@@ -61,10 +45,7 @@ Under tmux, atuin's `[tmux]` settings open the search in a tmux popup (80% wide,
|
||||
|
||||
## AI inline
|
||||
|
||||
Commit `a82921c` ("add Atuin AI inline integration and keybinding") added the <kbd>ctrl-w</kbd> bind to `fish_user_key_bindings.fish` and the following to `config.fish`:
|
||||
|
||||
1. `atuin ai init fish | source`, in the interactive block next to `atuin init fish`.
|
||||
2. A copy of the `_atuin_ai_question_mark` function that `atuin ai init fish` prints, and `bind "?" _atuin_ai_question_mark`.
|
||||
Commit `a82921c` ("add Atuin AI inline integration and keybinding") added the <kbd>ctrl-w</kbd> bind to `fish_user_key_bindings.fish`, `atuin ai init fish | source` to `config.fish`, and a copy of the `_atuin_ai_question_mark` function that command printed, with `bind "?" _atuin_ai_question_mark`. atuin 18.21 removed `atuin ai init`, so `config.fish` keeps only the copied function and binding; `atuin ai inline --hook` still works.
|
||||
|
||||
The config also sets `[ai] enabled = true`.
|
||||
|
||||
@@ -84,7 +65,7 @@ The config also sets `[ai] enabled = true`.
|
||||
|
||||
`bind "?"` in `config.fish` has no `-M` flag, so it applies to fish's `default` mode, which is vi **normal** mode here. In insert mode <kbd>?</kbd> types a question mark. To ask for a command, press <kbd>Esc</kbd> and then <kbd>?</kbd> on an empty line, or press <kbd>ctrl-w</kbd> from either mode. The <kbd>ctrl-w</kbd> bind calls `atuin ai inline` without `--hook` and replaces fish's default <kbd>ctrl-w</kbd> word deletion.
|
||||
|
||||
bash and zsh do not load `atuin ai init`.
|
||||
bash and zsh have no AI binding.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
Reference in new issue
Block a user