atuinsh / atuin

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

[Bug]: Defaults to fish and conf.d ? #2340

Open orsenthil opened 3 months ago

orsenthil commented 3 months ago

What did you expect to happen?

I expect atuin to install and setup the configuration

What happened?

(.venv) (base) ➜  todo git:(main) ✗ curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh
 _______  _______  __   __  ___   __    _
|   _   ||       ||  | |  ||   | |  |  | |
|  |_|  ||_     _||  | |  ||   | |   |_| |
|       |  |   |  |  |_|  ||   | |       |
|       |  |   |  |       ||   | |  _    |
|   _   |  |   |  |       ||   | | | |   |
|__| |__|  |___|  |_______||___| |_|  |__|

Magical shell history

Atuin setup
https://github.com/atuinsh/atuin
https://forum.atuin.sh

Please file an issue or reach out on the forum if you encounter any problems!

===============================================================================

downloading atuin 18.3.0 x86_64-apple-darwin
installing to /Users/senthil/.atuin/bin
  atuin
  atuin-update
everything's installed!
mkdir: /Users/senthil/.config/fish/conf.d: Permission denied
ERROR: command failed: mkdir -p /Users/senthil/.config/fish/conf.d

Atuin doctor output

~/.atuin/bin/atuin doctor
Atuin Doctor
Checking for diagnostics

Please include the output below with any bug reports or issues

{
  "atuin": {
    "version": "18.3.0",
    "sync": null,
    "sqlite_version": "3.46.0"
  },
  "shell": {
    "name": "zsh",
    "default": "zsh",
    "plugins": [],
    "preexec": null
  },
  "system": {
    "os": "Darwin",
    "arch": "x86_64",
    "version": "13.6.7",
    "disks": [
      {
        "name": "Untitled",
        "filesystem": "apfs"
      },
      {
        "name": "Untitled",
        "filesystem": "apfs"
      }
    ]
  }
}


### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
ellie commented 3 months ago

mkdir: /Users/senthil/.config/fish/conf.d: Permission denied

Looks like something is up with your home directory permissions. If you could fix those and retry, we should be good to go

amartyadav commented 3 months ago

@ellie , I have the exact problem when trying to download atuin using curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh.

And nothing else seems to have a problem with permissions in my home directory. Some detailed insight would be helpful.

I have zsh in my terminal, but atuin defaults to using .bash_profile and fish, just like OP's issue. I am not sure if that is the intended way, but my first instinct was that it should use my zsh profile? Or am I wildly wrong here? It is able to add the following lines to me .zshrc:

. "$HOME/.atuin/bin/env" eval "$(atuin init zsh)"

amartyadav commented 3 months ago

@orsenthil , I just realised that using the curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh installation method fails (at least on my macos apple silicon), and so does using homebrew (the tui doesn't show up even after successful installation from homebrew).

I reinstalled atuin using cargo (follow the docs, and install the rust toolchain using rustup first). Then in your terminal - echo 'eval "$(atuin init zsh)"' >> ~/.zshrc.

And then restart your terminal. This correctly installs it, and the tui is visible.

@ellie

ellie commented 3 months ago

Hmmm sounds like the part where we add the atuin binary to PATH is failing. I believe it adds it to all shells, will check. Can you share the file permissions you have set for that path? Or any parent directory of it, if it doesn't exist

Otherwise, our script automatically adds the shell init:

https://github.com/atuinsh/atuin/blob/90e7d28173ae281ba8c4e396c98da9b093b3bb42/install.sh#L43-L54

using homebrew (the tui doesn't show up even after successful installation from homebrew).

The docs cover installations with package managers, where manually installing the shell plugin is required: https://docs.atuin.sh/guide/installation/