sxyazi / yazi

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

Downloads (and config) directories are hardcoded #1229

Closed ArijanJ closed 3 days ago

ArijanJ commented 3 days ago

What system are you running Yazi on?

Linux X11

What terminal are you running Yazi in?

N/A

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

Tried, but the problem still

yazi --debug output

N/A

Describe the bug

Doing gd tries taking you to ~/Downloads, but this path may not always exist on different distributions and setups.

Expected Behavior

Ideally you should be taken to the value of $XDG_DOWNLOAD_DIR, and use ~/Downloads as a default if that doesn't work out.

To Reproduce

Open yazi, do gd with the default/preset configuration.

Configuration

Default preset

Anything else?

The ~/.config path can likely stay since I don't think anyone changes it, but I fully expected gd to work with a custom downloads directory. I realize this can be done with a tiny plugin, but it would be nice if all users could have the correct behavior OOTB.

sxyazi commented 3 days ago

This is intentional because some platforms (such as Windows) do not have $XDG_DOWNLOAD_DIR, and Yazi's key bindings do not support complex commands to simplify the design. But you can easily modify it:

[[manager.prepend_keymap]]
on   = [ "g", "d" ]
run  = 'cd $XDG_DOWNLOAD_DIR'