Repository navigation
Launch a browser whose desktop entry starts with env - #17134
sundarshahi wants to merge 6 commits into
Conversation
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryAdds shared parsing for browser desktop entries that start with
The earlier quoted-value, browser-lookup, and wrapper-handoff findings are fixed. The previous-review merge bases differ, so this review covered the full PR range.
|
An entry like Exec=env DRI_PRIME=0 chromium %U set the browser command to env, so every link open ran `env <url>` and silently did nothing, web apps ran `env --app=<url>`, and the default browser lookup counted env as an installed browser. Skip the env prefix to find the browser, and keep its variables for the launch and the handoff to a running browser. Fixes omacom#17074
The handoff ran without the entry's PATH, so it looked up a same-named browser on the session's PATH and could give the URL to that one while a wrapper the entry points at was bypassed. Resolve the executable on the entry's PATH and hand that path to omarchy-cmd-browser-handoff.
5c23ec0 to
f91b44f
Compare
|
Reviewed the shared parser, default-browser resolver, both launchers, handoff and regression cases at f91b44f, and compared #11728, #12533, #13240/#13241 and #15077. This was a source comparison; no worker tests ran in this session. The older #12533 also fixes env-wrapped launches and preserves the rest of the Exec command. I queued this PR’s shared-parser pattern, installed-browser check, entry-PATH lookup and resolver regression cases for integration into #12533, with @sundarshahi credited when those changes are made. The fold needs to retain that PR’s wrapper handling, including accepting Flatpak entries by their wrapper rather than looking up an app ID as a host executable. GPT-6 High in Codex reviewed this item. Opus 5.5 High favored continuing in #12533; muse-wonder via pi, thinking high initially favored this narrower PR because it also fixes the resolver. Both agreed in the supplementary comparison that #15077 does not displace #12533 and that handing these improvements to it is appropriate. Independence is not guaranteed. This PR remains open, waiting on the maintainer’s choice among the competing fixes. |
Resolve browser availability from the same parsed argv used by the launchers, honoring PATH assignments while retaining wrapper checks for Flatpak and env options. This folds omacom#17134's resolver fix and shared-helper pattern into omacom#12533 without discarding desktop arguments. Stop the assignment scan at env options, including --split-string=, so they retain their previous availability behavior. Co-Authored-By: sundarshahi <shahithakurisundar@gmail.com> Co-Authored-By: GPT-6 High <noreply@openai.com> Co-Authored-By: Opus 5.5 High <noreply@anthropic.com>
…-exec # Conflicts: # bin/omarchy-launch-browser
|
I read the change at 31ddc1c, its merge resolution, the browser resolver and both launchers, the review threads, and #17074. The merge resolution keeps the shared parser together with quattro’s StartupWMClass lookup. This was a source review; no worker tests ran. GPT-6 in Codex (reasoning effort not exposed) performed this review. I classify the change as a bug fix, but the configured classification model, deepseek-v4p1-flash, returned no usable class for this head. No second opinion reviewed this head in this session; the primary reviewer, Opus 5.5 High, also failed its health check. Classification remains unsettled, so verification is paused pending classification. The earlier comparison with #12533 remains unresolved; this session made no new choice between the competing fixes. |
|
The bug classification is now agreed at 31ddc1c. I compared the current parser, resolver, launchers and review threads with #12533, #13240/#13241 and #15077, and read #17074. This was source review; no worker tests ran because the competing-fix comparison leaves #12533 as the branch to pursue. #12533 has incorporated the shared-parser pattern and resolver checks in 8f78699, crediting @sundarshahi, while keeping the entry’s browser arguments. The remaining difference is that this PR allows env-prefixed entries to reach direct browser handoff; I handed that difference to #12533’s session to assess while preserving wrapper and profile handling. These are different implementations, so this PR remains open. GPT-6 in Codex (reasoning effort not exposed) reviewed this item. Opus 5.5 High and muse-wonder via pi, thinking high both favored continuing in the older #12533; their agreement is not guaranteed to be independent. Opus considered the remaining handoff optimization not worth adopting, while muse-wonder recommended carrying it over for review. This waits on the maintainer’s choice among the competing fixes; neither branch is marked ready by this review. |
|
I checked the merge at 7440e90 against current quattro, the resolver and launchers, review threads, #17074, and competing fixes #12533, #13240/#13241 and #15077. The merge preserves upstream MIME-app search order, CRLF handling and StartupWMClass lookup. This was source review; no worker tests ran because the competing-fix comparison leaves the older #12533 as the branch to pursue. #12533 already includes the credited shared-parser and resolver work and preserves the entry’s browser arguments and broader wrappers. I queued this merge’s desktop-entry reading and quoted-escape handling for its next pass, so those differences are assessed there. The read-loop pattern comes from upstream; direct handoff for env-wrapped entries remains optional. These are different implementations, so this PR remains open. GPT-6 in Codex (reasoning effort not exposed) reviewed this item. Opus 5.5 High and muse-wonder via pi, thinking high both favor continuing in #12533 after checking the current source; their agreement is not guaranteed to be independent. This waits on the maintainer’s choice among the competing fixes. |
|
The latest merge from GPT-6 in Codex (reasoning effort unavailable), Opus 5.5 High and muse-wonder via pi, thinking high reviewed the source and favored #12533. Their agreement may reflect shared session context. Worker verification was skipped for this competing fix. This PR remains open for the maintainer’s decision. |
Fixes #17074
A default browser whose desktop entry starts with an
envprefix, as inExec=env DRI_PRIME=0 chromium %U, cannot open links.omarchy-launch-browsertakes the first word ofExec=as the browser, so every link open runsenv <url>, which fails, and its output goes to null, so nothing visible happens.omarchy-launch-webappreadsExec=the same way and runsenv --app=<url>.omarchy-cmd-default-browserchecks the same first word to decide that a browser is installed, soenvpasses for any such entry, including one whose browser has since been removed.All three now skip a leading
envor/usr/bin/envand itsVAR=VALUEwords to find the browser. The launchers keep those variables, so the browser starts asenv DRI_PRIME=0 chromium <url>, as it does from the desktop entry. The private-flag probe and window focus use the browser itself. The handoff to a running Chromium-based browser runs with the entry's variables, exceptPATH, which it needs to find its own helpers, so an entry that points its browser at another profile (CHROME_CONFIG_HOME=,XDG_CONFIG_HOME=) is refused there and launched, instead of having its URL handed to the default profile. The browser's own flags after the command are still dropped, as before; this only changes the prefix.The three scripts read
Exec=through one shared helper,bin/omarchy-cmd-browser-exec, which splits it the way the Desktop Entry spec quotes it, without shell evaluation, soExec=env "CHROME_CONFIG_HOME=/home/alex/Browser Profiles" chromium %Ukeeps its value whole.omarchy-cmd-default-browserlooks the browser up on thePATHthe prefix sets, asenvwould launch it.launch-browser-test.shcovers a link and a web app opened through an env-prefixed entry, anddefault-browser-lookup-test.shcovers an env-prefixed entry for a removed browser. On Linux those two files,browser-handoff-test.sh,browser-link-handoff-test.sh,default-apps-test.shandlaunch-openclaw-test.shpass. Reverting each of the three scripts toquattrofails its new check. This applies cleanly with #16998, which changes the private-flag probe in the same file.With the follow-up commit,
launch-browser-test.shanddefault-browser-lookup-test.shalso cover a quoted value with spaces and a browser found only on the prefix'sPATH; both files pass on Linux (bash 5.2), and each new check fails on the first commit.test/cligives the same results with and without the follow-up.The third commit hands
omarchy-cmd-browser-handoffthe executable the entry'sPATHselects, so a wrapper there is launched instead of its URL going to a same-named browser on the session'sPATH.launch-browser-test.shcovers it; both files pass on Linux (bash 5.2), and the new check fails on the second commit.