kamiyaa / joshuto

ranger-like terminal file manager written in Rust
https://crates.io/crates/joshuto
GNU Lesser General Public License v3.0
3.34k stars 151 forks source link

Directory chooser #530

Closed devraza closed 3 weeks ago

devraza commented 2 months ago

Though joshuto has a file chooser (--file-chooser) this doesn't seem to work on directories. Ranger, however, apparently does support this (--choosedir). There should be an option to choose files or directories, which can be useful when selecting what directory a file should download to in qutebrowser, for example.

DLFW commented 1 month ago

Hi, I have no idea how --file-chooser works; Joshuto lacks documentation on that.

But what works for me is to use a temp-file for the output (joshuto --output-file /tmp/josh-selection) and then quit Joshuto with quit --output-current-directory (which I have mapped to Q). Downside: It returns the directory you're in, not the one that is selected. I agree it's not great but it does the job for me.

Also agree that a straight-forward --dir-chooser would be a good enhancement. (And some docs for --file-choose.)

devraza commented 1 month ago

@DLFW as it turns out, that is actually how Ranger works with its --choosedir. And I'm not sure if there's a need to add an argument to provide this functionality if it can be done without a separate argument. Though I do think there's a lack of documentation around --file-chooser as I couldn't figure out how it worked today - it looks like it needs to be paired with --output-file though.