denisidoro / navi

An interactive cheatsheet tool for the command-line
Apache License 2.0
15.19k stars 507 forks source link

Installing navi correctly on MacOS for .zsh #777

Open AnvarAtayev opened 2 years ago

AnvarAtayev commented 2 years ago

I am just wondering if I have installed navi correctly.

I am using macOS Monterey 12.5 and installed navi using homebrew via brew install navi. To install the shell widget, I pasted the following into the end of my .zshrc file:

# zsh
eval "$(navi widget zsh)"

(I do not have a .bshrc file, and thought this was the alternative).

Having done the above step, I am now able to use navi by calling Ctrl + G as expected.

Entering navi fn welcome and entering the config command, I get a permission denied error.

Screenshot 2022-08-12 at 11 30 52 Screenshot 2022-08-12 at 11 32 23

I'm not sure how to overcome this. Also, I am noticing that it is trying to use bash instead of zsh. Not sure how to change this also.

Any help would be appreciated.

welcome[bot] commented 2 years ago

Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)

wiegell commented 2 years ago

same on armbian, related? https://github.com/denisidoro/navi/issues/777

jjournet commented 2 years ago

I have the same issue on MacOS Monterey (M1), and I think the problem is related to the hardcoded path of the config file containing a space, and not handled correctly by navi 2 things:

jjournet commented 2 years ago

I would say issue was introduced in change #518 I don't code in Rust, so I can't propose a fix

jjournet commented 2 years ago

Actually, in the current version, it's not working on Mac, because you can't have a config file (Navi doesn't find it because of the space), the checkout of new libraries works (I was able to get the defaults cheats), but navi doesn't see them (I was using an older version until recently when I switched to brew)

jjournet commented 2 years ago

I was wrong, actually version 2.19 is working fine with the path, sticking to this one for now, but:

dmartzol commented 2 years ago

the default config file should be in ~/.config/navi, not in Library (IMHO)

+1

Most CLI apps have the config in ~/.config. Having the config file in a different location just makes dotfiles management more difficult, IMHO

denisidoro commented 1 year ago

The config dir is defined by https://crates.io/crates/directories-next

Changing it now would be a breaking change :/

denisidoro commented 1 year ago

I'm trying to understand if the problem is really with the space. Could you provide more logs / evidence?

"permission denied" seems to be unrelated to spaces