I have RStudio installed, and 'xdg-open x.cpp' opens x.cpp with RStudio despite its MIME file /usr/local/share/mime/packages/rstudio.xml doesn't say that RStudio can open *.cpp files. Sometimes *.r files are opened with vscode when it is installed in addition to RStudio, even though vscode doesn't install any MIME files. Something is wrong with xdg-open.
Add upstream bug report.
That upstream report contains no information (just a link to this PR) so it's not going to get much attention. Frankly, I'm surprised it wasn't just closed as "not-actionable here". `xdg-open` is a shell script. Please run it with shell-tracing enabled, e.g.: ``` sh -x /usr/local/bin/xdg-open x.cpp ``` For me, the trace is short, and all xdg-open ends up doing is calling kde-open5, so *if* I could reproduce this, I'd have to look at -- and re-file the PR -- against kde-open5, not xdg-open. [[ What kind of configuration options / build machine parameters are suggested for RStudio? I can't build it with poudriere because it always crashes with too many open files. ]]
[[ I See that devel/RStudio/Makefile has a comment about the too-many-files; I can follow that. ]] Rstudio **does** register something for C and C++ files, though: after installation RStudio is presented in KDE settings as one of the options for C++ headers. Since it's at the end of the list, something else gets it first.
- devel/RStudio installs /usr/local/share/applications/rstudio.desktop . It also installs /usr/local/share/applications/rstudio.desktop.bak, which seems less-than-useful. - In /usr/local/share/applications/rstudio.desktop, it claims C and C++ headers and sources: ``` MimeType=text/x-r-source;text/x-r;text/x-R;text/x-r-doc;text/x-r-sweave;text/x-quarto-markdown;text/x-r-markdown;text/x-r-html;text/x-r-presentation;application/x-r-data;application/x-r-project;application/x-rdp-rsp;text/x-r-history;text/x-r-profile;text/x-tex;text/x-markdown;text/css;text/javascript;text/x-chdr;text/x-csrc;text/x-c++hdr;text/x-c++src; ``` There is nothing wrong with xdg-open.