sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
11.43k stars 266 forks source link

Possibile permission error when installing on macOS (14.5) via Homebrew #1202

Closed nekonora closed 6 days ago

nekonora commented 6 days ago

What system are you running Yazi on?

macOS

What terminal are you running Yazi in?

iTerm2

Did you try the latest code to see if this problem got fixed?

Tried, but the problem still

yazi --debug output

```sh Backtrace omitted. Run with RUST_BACKTRACE=1 to display it. Run with RUST_BACKTRACE=full to include source snippets. The application panicked (crashed). initializing rolling file appender failed: InitError { context: "failed to create initial log file", source: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } } in /Users/{myUser}/Library/Caches/Homebrew/cargo_cache/registry/src/index.crates.io-6f17d22bba15001f/tracing-appender-0.2.3/src/rolling.rs, line 154 thread: main ```

Describe the bug

Just wanted to try out Yazi and installed it via homebrew on macOS Sonoma (14.5) (tried both stable 0.2.5 and HEAD versions, same error), but upon launching it with yazi a permission error is returned. Looks like incorrect/missing folder permissions on where it's going to save logs in this case.

Running with sudo works fine, but I suppose it should do it without it.

Expected Behavior

Yazi starting

To Reproduce

Configuration

None, didn't add any custom config

Anything else?

No response

sxyazi commented 6 days ago

Yazi needs to create log files in the ~/.local/state/yazi directory. Does it have write permissions? And what does echo $XDG_STATE_HOME say?

nekonora commented 6 days ago

Thanks for you time, that was it actually!

For anyone who might encounter the same issue: So, $XDG_STATE_HOME wasn't set to anything (I think macOS does not fill these out by default). I set them up in zsh so that now XDG_STATE_HOME is ~/.local/state. I then fixed permissions for the folder and files and everything is now working.

Closing the issue