xdg-open can invoke interaction on KDE
Submitted by Francois Gouget
Assigned to Fathi Boudra
Description
-
xdg-open may or may not return immediately For instance try: echo Bar >foo.txt xdg-open foo.txt In Gnome xdg-open returns immediately while in KDE / Mailcap it blocks until the application exits.
-
xdg-open may or may not return an error when the association is missing For instance try: dd bs=1 count=20 if=/dev/random of=foo.noassoc xdg-open foo.noassoc In Gnome / Mailcap it returns immediately with a non-zero exit code, while in KDE blocks while it opens a dialog asking what application to open the file with. If you click cancel in that dialog xdg-open exits with zero as the exit code.
These two properties make it very hard for a GUI application to know if the file was opened correctly or not as you cannot rely on its exit code. Not only could it very well be zero in the case of a missing association, but how long should one wait to obtain it?
Version: 1.0