fix(windows): delegate to winebrowser under Wine#121
Merged
Conversation
When running a Windows-targeted binary under Wine, open requests previously fell back to Wine's bundled `explorer.exe`, which lacks proper host desktop integration. This change detects the Wine environment at runtime (via `WINEPREFIX`, `WINELOADER`, or `WINEDEBUG`) and prepends a winebrowser command to the launcher list. `winebrowser` is Wine's official utility for forwarding file/URL requests to the host OS's default handler (e.g., `xdg-open` on Linux, `open` on macOS). If winebrowser is unavailable or fails, the existing `cmd /c start` fallback is used automatically, preserving backward compatibility. No public API changes or compile-time flags are introduced.
Byron
approved these changes
May 11, 2026
Owner
There was a problem hiding this comment.
Thanks a lot, this looks great!
The video also does a great job, thank you. I was totally unaware that macOS and Wine and Dolphin can somehow work together, miraculous.
A new release is now available: https://github.com/Byron/open-rs/releases/tag/v5.3.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When running a Windows-targeted binary (
.exe) under Wine, open requests previously fell back to Wine's bundledexplorer.exe, which lacks proper host desktop integration.This change detects the Wine environment at runtime (via
WINEPREFIX,WINELOADER, orWINEDEBUGenv variables) and prepends awinebrowsercommand to the launcher list, becausewinebrowseris Wine's official utility for forwarding file/URL requests to the host OS's default handler (e.g.,xdg-openon Linux,openon macOS).If
winebrowseris unavailable or fails, the existingcmd /c startis used as a fallback. No public API changes or compile-time flags are introduced.Screencapture of the changes (with a before/after) to compare, on macOS, using a freshly installed
wine(usingbrew install --cask wine@staging):open-rs-wine-awareness-480p.mov
Screenshot running on Linux Mint, with a Wine instance wrapped by Lutris, starting correctly my default file browser Dolphin:
I have not bumped the
Cargo.tomlversion (it should be the patch level) nor thechangelog.mdas I do not know whether you have your own release workflow. The changelog gives me the impression it's automatically updated, given the comment blocks?EDIT: LLM usage disclosure: I've used the web interface of Qwen3.6-Plus at chat.qwen.ai to get guidance on what could be different implementation paths. It provided sample code snippets that looked good to me.