Skip to content

System: run xdg-open in the background in openURL() - #44

Merged
dimensionscape merged 1 commit into
masterfrom
fix/open-url-linux
Nov 24, 2026
Merged

dimensionscape merged 1 commit into
masterfrom
fix/open-url-linux

Conversation

@dimensionscape

Copy link
Copy Markdown
Member

openURL() passes "&" to xdg-open as a second argument. runCommand() doesn't use a shell, so the & doesn't background anything: xdg-open rejects the extra argument, exits with an error, and the failed command stops the caller. Lime's tools now hit this on Linux, since lime test html5 serves through CrossByte and calls openURL(). Before, node's http-server opened the browser itself, so the bug went unnoticed.

xdg-open now runs through the shell with the URL single-quoted, in the background, with its output discarded. It's started with ignoreErrors, so a failure no longer stops the caller. Windows and macOS are unchanged.

Checked by running the same command string through sh -c with a stand-in xdg-open that records its arguments and sleeps for 5 seconds. The URL http://127.0.0.1:3000/?a=1&b='two words' arrives as the only argument, and the call returns in about 150 ms. The old form gave xdg-open two arguments, the URL and &. Not run on a Linux desktop with a real browser. Compiles with Haxe 3.4.7 and 4.3.7.

openURL() passed "&" to xdg-open as a second argument, since runCommand() runs the command without a shell. xdg-open rejects the extra argument and exits with an error, which also stops the caller, as lime test html5 now does on Linux.

xdg-open now runs through the shell with the URL quoted, in the background, with its output discarded, and a failure no longer stops the caller.
@dimensionscape
dimensionscape merged commit 07ae359 into master Nov 24, 2026
12 checks passed
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.

1 participant