kamiyaa / joshuto

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

open command does not respect mimetype.toml #490

Open BigBrotherJu opened 9 months ago

BigBrotherJu commented 9 months ago

When I press l or enter in joshuto, the text file (with extention and without extention) under cursor is not opened according to mimetype.toml. Instead, the bottom line displays :open_with.

My config folder ~/.config/joshuto does not contain mimetype.toml, so joshuto should be using the default one.

I'm on Mac Sonoma with joshuto 0.9.6.

kamiyaa commented 8 months ago

The default config may not contain an editor that your system has, which is why its prompting :open_with

For mac, I would recommend enabling

xdg_open = true
xdg_open_fork = true

inside joshuto.toml

BigBrotherJu commented 8 months ago

The default config may not contain an editor that your system has, which is why its prompting :open_with

But I already installed micro and bat. According to the default mimetype.toml, one of them should be used when opening text file. @kamiyaa

BigBrotherJu commented 7 months ago

Figured it out. The default mimetype.toml has to be present in my ~/.config/joshuto folder for l or enter to work.

This seems to contradict the statement in config doc:

Joshuto's behavior is:

  • If there exists a config file, use that config. (No default or inherited values from a default config)
  • If there is no config file, a default config will be used (found under config/)

In my case, if there is no mimetype.toml in ~/.config/joshuto, the default mimetype.toml is not used.

bulletmark commented 6 months ago

I installed joshuto on Arch looking to try a faster ranger but every file I open just prompts :open_with as the OP here describes.

I notice that the joshuto package (or the joshuto-bin package) on Arch just installs a single file /usr/bin/joshuto does that seem right?