You are not logged in.

#1 2020-10-08 16:30:55

fourier54
Member
Registered: 2020-10-02
Posts: 2

xdg-open blocking terminal

When opening pdf files with xdg-open with zathura configured as the viewer, xdg-open keeps running until I close zathura. When firefox is configured as the viewer, xdg-open returns correctly and I can continue using the terminal.

Is this a configuration problem? I Couldn't find anything about this behaviour in the man pages. I assumed that the correct behaviour was for xdg-open to always return so the terminal remains usable.

Offline

#2 2020-10-08 17:37:03

jsoy9pQbYVNu5nfU
Member
Registered: 2013-04-19
Posts: 108

Re: xdg-open blocking terminal

Just find out. Run xdg-open using

bash -x /usr/bin/xdg-open /your/file

and it'll trace the shell execution path. If you're on a proper desktop environment, I suggest you just bypass the mess that is the xdg-open shell script and use the canonical XDG opener from your DE, for example, under KDE5, it's kde-open5, and I always have this alias as part of my rc:

alias open=kde-open5

On proper DEs, xdg-open should just proxy to your DE's tool/binary, so if you're still hitting this issue without xdg-open inbetween, with direct commands, you should continue working on debugging said command.

PS. Unlike firefox, zathura does not have a remote process model (opening files/tabs/URLs in existing program instances). This is why the xdg-open command might block in general, just with firefox, this fact is not relevant to the experience. Does it also work as you want if you have no Firefox window open before using the command? That being said, on my system, kde-open5 never blocks but always launches a detached process.

Last edited by jsoy9pQbYVNu5nfU (2020-10-08 17:42:12)

Offline

#3 2020-10-08 18:12:19

fourier54
Member
Registered: 2020-10-02
Posts: 2

Re: xdg-open blocking terminal

Thanks for the answer. I'm not using any DE, just i3 on top of Xorg. Skimming through the script, I noticed that it explicitly switches between the different DE, and in my case it is fallbacking to DE=generic. So (unfortunately) I can't solve it with an alias like yours.

I tried with no Firefox window opened and it presented the same behaviour: it blocked the terminal. So it seems to have nothing to do with Zathura or a particular application. It's hard to tell if this is a bug because the documentation it's not clear about which behaviour should the program have.

Offline

#4 2020-10-08 18:38:53

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: xdg-open blocking terminal

You could patch xdg-open, replace it with your custom script, use and alternative like "handlr" or "mimeo", both in the AUR. For both of those there are also patched versions of xdg-open available called xdg-utils-mimeo, and xdg-utils-handlr.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

Board footer

Powered by FluxBB