Skip to content

Conversation

Damglador
Copy link
Contributor

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).

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.
@IntegratedQuantum
Copy link
Member

Does this work on macos too?
Also please link a reference that mentions the deprecation/removal.

@Damglador
Copy link
Contributor Author

Damglador commented Oct 8, 2025

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 open.

Fedora 41 and Ubuntu 25 also don't have a package called open.

@Damglador
Copy link
Contributor Author

@Damglador
Copy link
Contributor Author

The primary purpose of OS X's open command is to open a file in the associated application. The equivalent of that on modern non-OSX unices is xdg-open.

https://unix.stackexchange.com/questions/253376/open-command-to-open-a-file-in-an-application#253531

Somewhat of a reference of deprecation

@IntegratedQuantum
Copy link
Member

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 open.

@Argmaster
Copy link
Collaborator

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)

@Damglador
Copy link
Contributor Author

Fedora 41, Ubuntu 25 (both tested in distrobox) and Arch Linux don't have open command and open package, but all have xdg-open installed and the xdg-utils package.

Pretty sure all other software uses xdg-open as well, so if a user doesn't have it, that's their problem.

@Damglador
Copy link
Contributor Author

My bad, Ubuntu 24

@Damglador
Copy link
Contributor Author

Damglador commented Oct 8, 2025

┌─[damglador@Parasite][~]
└% \cat /etc/*-release | grep ^VERSION= ; \cat /etc/*-release | grep ^NAME=
VERSION="41 (Container Image)"
NAME="Fedora Linux"
┌─[damglador@Parasite][~]
└% command -V open
open not found
┌─[damglador@Parasite][~]
└% command -V xdg-open
xdg-open is /usr/local/bin/xdg-open
┌─[damglador@Parasite][~]
└% \cat /etc/*-release | grep ^VERSION= ; \cat /etc/*-release | grep ^NAME=
VERSION="24.04.2 LTS (Noble Numbat)"
NAME="Ubuntu"
┌─[damglador@Parasite][~]
└% command -V open                                                         
open not found
┌─[damglador@Parasite][~]
└% command -V xdg-open                                                     
xdg-open is /usr/local/bin/xdg-open
┌─[damglador@Parasite][~/Scripts/vs-server-tmux]
└% \cat /etc/*-release | grep ^VERSION= ; \cat /etc/*-release | grep ^NAME=
NAME="Arch Linux"
┌─[damglador@Parasite][~/Scripts/vs-server-tmux]
└% command -V open                                                         
open not found
┌─[damglador@Parasite][~/Scripts/vs-server-tmux]
└% command -V xdg-open                                                     
xdg-open is /usr/bin/xdg-open

Edit: use -V option instead of -v so it explicitly says that command is not found.

@IntegratedQuantum
Copy link
Member

Pretty sure all other software uses xdg-open as well

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.

both tested in distrobox

Are these even real systems?

@Damglador
Copy link
Contributor Author

Are these even real systems?

Yes.

I don't want installing multiple VMs just to prove that open isn't used anymore. If opening file manager will remain broken, so be it.

@IntegratedQuantum
Copy link
Member

Is not one article on the whole internet that talks about this?

@Damglador
Copy link
Contributor Author

@Argmaster
Copy link
Collaborator

Ok, I just checked on my Ubuntu 24.04 and open is an alias for xdg-open .


That said, I am worried about how much time we spent on discussing this.
As far as I understand we do not have a concrete bug report from user discovering a feature doesn't work, so essentially this is fixing a non-existing issue to follow an standard which is not mandatory to follow.
In meantime we have plenty of serious features missing in the engine and plenty pending pull requests which actually improve significant parts of the game.
Really, its lowest priority and lowest visibility issue out of them all, so whether we pull this or not does not matter, as long as it doesn't regress the codebase.
I think we should have a policy for handling situation like this, because I don't think this is really helpful.

Copy link
Member

@IntegratedQuantum IntegratedQuantum left a 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.

@IntegratedQuantum IntegratedQuantum merged commit 93b32fc into PixelGuys:master Oct 8, 2025
1 check passed
@Damglador
Copy link
Contributor Author

Damglador commented Oct 8, 2025

As far as I understand we do not have a concrete bug report from user discovering a feature doesn't work, so essentially this is fixing a non-existing issue to follow an standard which is not mandatory to follow.

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.

@IntegratedQuantum
Copy link
Member

Why didn't you just say so?

@Damglador
Copy link
Contributor Author

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).

In the PR description. This makes it broken.

@Argmaster
Copy link
Collaborator

Ok, next time please start "X does not work" then the rest. Lov ya C:

codemob-dev pushed a commit to codemob-dev/Cubyz that referenced this pull request Oct 9, 2025
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).
IntegratedQuantum pushed a commit that referenced this pull request Oct 19, 2025
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants