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

xdg-open stucks #369

Open otakutyrant opened 11 months ago

otakutyrant commented 11 months ago

xdg-open .zshrc works. But in joshuto when I locate the file and hit l, it stucks like below:

2023-07-16-230501_696x168_scrot

There is xdg-open = true in my joshuto.toml and I do not have mimeapps.toml.

kamiyaa commented 11 months ago

What application do you have set for opening .zshrc?

otakutyrant commented 11 months ago

Sorry, actually I have a mimeapps.list, and it is generated by unknown something. Here is the context:

[Default Applications]

image/bmp=feh.desktop
image/jpeg=feh.desktop
image/jpg=feh.desktop
image/png=feh.desktop
image/tiff=feh.desktop
image/x-bmp=feh.desktop

text/plain=nvim.desktop

image/gif=mpv.desktop
video/avi=mpv.desktop
video/flv=mpv.desktop
video/mp4=mpv.desktop
video/mpeg=mpv.desktop
video/quicktime=mpv.desktop
video/vnd.rn-realvideo=mpv.desktop
video/webm=mpv.desktop
video/x-matroska=mpv.desktop
video/x-ms-asf=mpv.desktop
video/x-ms-wmv=mpv.desktop
video/x-msvideo=mpv.desktop
video/x-ogm=mpv.desktop
video/x-theora=mpv.desktop

x-scheme-handler/http=google-chrome.desktop
x-scheme-handler/https=google-chrome.desktop

inode/directory=org.gnome.Nautilus.desktop
x-scheme-handler/trash=org.gnome.Nautilus.desktop

application/epub+zip=com.github.johnfactotum.Foliate.desktop
text/html=google-chrome.desktop
x-scheme-handler/about=google-chrome.desktop
x-scheme-handler/unknown=google-chrome.desktop

So it should be nvim.

EDIT: xdg-mime query filetype .zshrc returns text/plain. xdg-mime query default text/plain returns nvim.desktop. nvim .zshrc works well.

kamiyaa commented 11 months ago

This is probably because joshuto and nvm are both terminal applications and will fight for terminal events.

I updated the xdg code to try to block on the application with xdg_fork = false in joshuto.toml

11112087094046da2c6456ddbd9e90f982f86f11

Let me know if this fixes it!

otakutyrant commented 11 months ago

It still stucks, but it doesn't show Using default keymapping any more.