-
Notifications
You must be signed in to change notification settings - Fork 159
Use "xdg-open" instead of "open" #1925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
xdg-open is a standardized way of opening files/folders/URLs with a default program. `open` doesn't even exist on my system or in any packages in Arch repos.
Does this work on macos too? |
I won't be able to find reference of deprecation/removal, I only know that no one uses it anymore on Linux. No clue about MacOS. I could add a separate check for MacOS to use Fedora 41 and Ubuntu 25 also don't have a package called |
https://unix.stackexchange.com/questions/253376/open-command-to-open-a-file-in-an-application#253531 Somewhat of a reference of deprecation |
Look, I need some definitive prove that xdg-open is the preferred and right way to open a folder and is preinstalled on more platforms than just |
I think that may not be possible to proof, so I would suggest instead using either as fallback and providing concrete proof that there is a popular Linux distro where open doesn't work (eg. Is not aliased or sth) |
Fedora 41, Ubuntu 25 (both tested in distrobox) and Arch Linux don't have Pretty sure all other software uses |
My bad, Ubuntu 24 |
Edit: use -V option instead of -v so it explicitly says that command is not found. |
You keep making these claims. I have never heard about xdg before. The only stackoverflow on this topic doesn't mention it either. You got to give me something.
Are these even real systems? |
Yes. I don't want installing multiple VMs just to prove that |
Is not one article on the whole internet that talks about this? |
Ok, I just checked on my Ubuntu 24.04 and That said, I am worried about how much time we spent on discussing this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is exactly what I need to remove my doubts, thank you.
May I ask, why was open used in the first place?
I looked for how to open a file explorer from code, which only lead to the old stackoverflow linked above which suggested open, but your references are better.
I think that may not be possible to proof, so I would suggest instead using either as fallback
Well, until we can find an actual counter-example where xdg-open doesn't work, I think it's better to use just the xdg-open option, since it (as now shown) does seem to be the more common option. Anything else would needlessly complicate the logic.
That said, I am worried about how much time we spent on discussing this.
Yes I agree, for now the damage is done, may as well merge it. I think a policy about it would make sense.
I would report it. I was testing #1913 and noticed that the game doesn't open file manager when it should. But I decided to just fix it, since it was easier than writing an Issue. |
Why didn't you just say so? |
In the PR description. This makes it broken. |
Ok, next time please start "X does not work" then the rest. Lov ya C: |
Simple change to use xdg-open command for opening system file manager on Linux instead of outdated "open". xdg-open is a standardized way of opening files/folders/URLs with a default program on Linux. Unlike `xdg-open`, `open` doesn't come by default on Ubuntu 25 or Fedora 41, and it's missing from Arch repos completely (only available on AUR).
Simple change to use xdg-open command for opening system file manager on Linux instead of outdated "open". xdg-open is a standardized way of opening files/folders/URLs with a default program on Linux. Unlike `xdg-open`, `open` doesn't come by default on Ubuntu 25 or Fedora 41, and it's missing from Arch repos completely (only available on AUR).
Simple change to use xdg-open command for opening system file manager on Linux instead of outdated "open".
xdg-open is a standardized way of opening files/folders/URLs with a default program on Linux.
Unlike
xdg-open
,open
doesn't come by default on Ubuntu 25 or Fedora 41, and it's missing from Arch repos completely (only available on AUR).