Repository navigation
Resolve wrapped desktop Exec= in browser and webapp launchers - #12533
paulogeyer wants to merge 10 commits into
Conversation
Automated AI review
Verified: the issue #10988 case now works in both launchers, and stock browser entries behave exactly as before. With
Stock Exec lines for Chromium, Firefox, Zen, Brave, Brave Origin, Helium and Chrome produce identical arguments, private flag and focus pattern on base and head. An env-wrapped Firefox still gets Two problems remain in wrapped forms other than Other wrappers pick the wrong browser token: private windows open as normal windows, and focus can jump to an unrelated window
Firefox 156 treats Impact: in these configurations, the private-browser shortcut opens a non-private Firefox window with no warning, and opening a link can focus an unrelated window. On base these lines launched nothing, so no working setup regresses. The PR description names Suggested change: skip option tokens ( Quoted Exec arguments are split into broken arguments
Impact: the intended profile option is lost, and the browser receives two junk arguments. Base ignored all extra Exec arguments and opened the browser normally, so this changes behavior for user overrides with quoted arguments. No stock browser entry that was checked uses quoting. A quoted Suggested change: unquote Exec arguments as the spec defines (double quotes with backslash escapes, Optional test improvement: both new mocks log Flatpak scope note: Flatpak browsers export desktop files under Review informationTest scope: source review of both launchers, their in-repo callers and AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments with targeted cross-checks, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Reviewed and verified at 0600d1f on a disposable Omarchy worker, by Claude Opus 5.5 with Codex Medium as second opinion. I pushed two commits to this branch:
What was checked. On quattro, Second opinion. Codex Medium was asked, without my answer, which of #11728, this pull request and #13240/#13241 to bring forward. It chose this one as the most proportionate once quoting was fixed. That agrees with my own reading, though its independence is not guaranteed. On this head it found no defect in the unquoting, the stock entries, the handoff or shell safety. It raised three gaps, all in wrapper forms quattro never launched at all, and I left them unfixed:
All of these now launch where before they launched nothing. The remaining gap is that a private window for those wrappers opens as a normal one. Competing fixes. #11728 and #13240/#13241 fix the same bug differently. #11728 drops every argument after the URL and still splits quoted spaces. #13240 probes and focuses This closes #10988 and #11718, and is now waiting on the maintainer. |
[Medium impact] The changes affect browser selection and browser and web-app launches. The wrapper-dependent private-window check still needs fixing before merging. Findings
SummaryBrowser and web-app launches now preserve the complete desktop-entry command.
|
|
Brought this up to date with
What was checked, on a disposable Omarchy worker:
Second opinion. Codex Medium agreed the merge resolution loses nothing from either side. It raised the Not covered. For a This closes #10988 and #11718. It is waiting on the maintainer, who also decides between this one and #13240/#13241, which fix the same bug. |
|
I pushed one commit to this branch, 6589416, which adds a regression test for a default browser whose desktop id contains spaces. #16226 fixes the same bug and carried this test. This pull request is older and already fixes the bug in both launchers, so the test is folded in here, with @audreyt credited as co-author. What was checked, on a disposable Omarchy worker:
Second opinion. Codex Medium and muse-spark-1.3 at high thinking reviewed the commit. Both found no defects. They confirmed that each case goes through the spaced-id lookup, would fail against This closes #10988 and #11718. It is waiting on the maintainer, who also decides between this one and #13240/#13241, #15077 and #16226, which fix the same bug. |
|
Ran this branch ( Default browser Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=vivaldi --file-forwarding com.vivaldi.Vivaldi @@u %U @@ --use-gl=egl --disable-features=VaapiVideoDecoder
The desktop id gate predates this branch. A reverse-DNS id does not match it, so browser=$(omarchy-cmd-default-browser)
+app_id=${browser%.desktop}
+if ! flatpak info "$app_id" >/dev/null 2>&1; then
case $browser in
google-chrome* | brave* | microsoft-edge* | opera* | vivaldi* | helium*) ;;
*) browser="chromium.desktop" ;;
esac
+fiYour parsing is fine, it is not reached. With the gate skipped your argv ( #15077 and #13241 stop at the same gate. Comparison on #11718. |
Split the whole Exec line by the Desktop Entry spec's quoting and escapes, expand %c and %k, drop the other field codes and a standalone --, and launch the full argv, so env- or flatpak-wrapped entries start the real browser. The private-flag probe and window focus use the first token that is not env, an env option or assignment, or flatpak run. The entry is read from the XDG data dirs omarchy-cmd-default-browser searched, and an entry with no usable Exec= keeps the visible not-found notification. Co-authored-by: 唐鳳 <au@civic.ai>
6589416 to
676d138
Compare
|
Thanks @SorenHJohansen, that's a clear trace, and good to know the parsed argv plus The Flatpak default-browser case is out of scope here: it's the launcher's desktop-id gate, which predates this PR, not the I didn't fold the |
|
I reviewed the rewrite at 676d138 and pushed two commits to the test file, 76f5bfe and 5a0be24. The launchers are unchanged. The web app cases from What was checked, on a disposable Omarchy worker:
Second opinion. Codex Medium and muse-wonder at high thinking reviewed this head and found no regression from Some gaps are already on Competing fixes. #13240/#13241, #15077, #16226 and #17134 fix the same bug. Both reviewers chose this one, the oldest: it covers both launchers, keeps the full argument list, handles This closes #10988, #11718 and #17074. It is waiting on @paulogeyer to share the parser between the two launchers. After that it waits on the maintainer, who chooses between the competing fixes. |
A Flatpak entry's browser is its app id, which is no command on the host, so probing it for --help found nothing and a private Flatpak Firefox got --incognito and opened a normal window. The flag now comes from the app id. The browser inside an env -S string is found too, rather than probing env itself. Co-Authored-By: Raj-Jagadeesh-A-P <rajjagadeesh2006@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Splitting the env -S string on whitespace took a quoted value apart, so "LABEL='Work Browser' firefox" settled on Browser' rather than firefox. xargs splits it with the same quoting env uses. A Flatpak run through env also missed the app id path, since only a leading flatpak was recognised. Assignments and empty words are skipped before flatpak is looked for, so FLATPAK=/usr/bin/flatpak or env -S "" does not stop the search. Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: muse-wonder via pi, thinking high <noreply@meta.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I pushed two commits to What was wrong: for a Flatpak default browser ( What changed: a Flatpak's private flag now comes from its app id without running anything: What was checked, on a disposable Omarchy worker: Second opinion: Codex Medium and muse-wonder (via pi, thinking high) reviewed the commits over three rounds. Between them they found that splitting Still open: |
quattro's web app launcher now falls back to google-chrome.desktop, then chromium.desktop, when the default browser is not Chromium-based. Run this branch's full Exec= parser over that list, taking the first entry it can read a command from, and check the parsed argv rather than the first word for the empty-command guard. The fallback tests now read the launch log one argument per line, as the mock writes it on this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This pull request had started conflicting with How the conflict was resolved: the web app launcher keeps What was checked, on a disposable Omarchy worker: Second opinion: Codex Medium and muse-wonder (via pi, thinking high) reviewed the merge, and both found the resolution correct. Their agreement isn't guaranteed to be independent of mine. Codex raised one point about the parser this pull request already had: it drops every standalone Competing fixes: #13241 and #17134 have both changed since the last comparison, so the open fixes for #11718 were compared again with both reviewers. They agreed this one stays the fix to bring forward. It is the oldest, it covers both launchers, and it launches the whole Still open, and waiting on the author: the ask from the last two comments stands. Share the |
| com.microsoft.edge) private_flag="--inprivate" ;; | ||
| *) private_flag="--incognito" ;; | ||
| esac | ||
| elif "$browser_exec" --help 2>/dev/null | grep -q MOZ_LOG; then |
There was a problem hiding this comment.
Private launches lose wrapper settings
If the desktop entry uses Exec=/usr/bin/env -C /opt/firefox ./firefox %u, the scan selects ./firefox, but this --help check runs in the launcher's current directory. If Firefox is only reachable through the wrapper, the check fails and selects --incognito instead of --private-window. The actual launch keeps the wrapper, so Firefox starts with the wrong flag and the requested private window may not open.
Preserve the wrapper's environment and working directory when checking the browser's private flag.
|
On Greptile's P1 about the private-flag probe in What it does: the token scan skips the Why it's left as it is: If you take it on while sharing the parser: record where the scan found the browser, and probe through the wrapper with Who checked: I traced both entries against the head (a01a184) and Still waiting on the author: share the |
|
One more case for the shared parser, in Who checked: Codex Medium found this, and I confirmed it by reading the code at a01a184 against Still waiting on the author: share the |
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>
|
Pushed 8f78699 to bring in #17134’s shared-parser pattern and resolver checks, crediting @sundarshahi. Both launchers and On a disposable Omarchy worker, the removed-browser reproduction fails with both GPT-6 High in Codex reviewed the change. Opus 5.5 High found that an attached The shared-parser request is addressed. This remains with the maintainer for the failing full suite and the choice among the open fixes. The captures show the same launch attempt with only the resolver changed: the old check selects the removed browser and opens no window; the new check selects Chromium and opens the local test page. They establish this fallback case, rather than general browser behavior. |
…ommands Read StartupWMClass from the desktop file selected by the shared Exec parser, so the window-class focus fix from omacom#18640 and wrapped command launching use the same entry. Keep quattro's declared-class lookup and binary-name fallback. Co-Authored-By: GPT-6 <noreply@openai.com>
|
Pushed 18c292f to resolve the conflict with On a disposable Omarchy worker, the wrapped Chromium launch opens no window on GPT-6 in Codex (reasoning effort not exposed) checked this change. Opus 5.5 High and muse-wonder via pi, thinking high found no new actionable defect in the merge resolution. Their agreement is not guaranteed to be independent. Both rechecked #13240/#13241, #15077, #16226 and #17134 and favored continuing here as the oldest fix covering both launchers and the resolver; the maintainer still chooses among them. The shared-parser and resolver work from #17134 is already included and credited in 8f78699; its remaining direct-handoff idea is an optional speed-up, which both recommend leaving for a separate maintainer decision. Greptile’s review of this head repeats the existing private-wrapper finding. The private-flag probe still does not preserve an env wrapper’s PATH or working directory. This remains open. The maintainer also needs to decide whether to carry the The captures show the same wrapped launch on the base and this head. They establish that Chromium opens this local page with the wrapper preserved; they do not establish private-window behavior. |
Read the selected desktop entry once in the shared parser, preserving quattro’s carriage-return handling and builtin field reads alongside the full wrapped command. Keep the MIME list search order and cache loop from quattro, and return the declared window class from the same entry. Co-Authored-By: GPT-6 (reasoning effort not exposed) <noreply@openai.com>
The launcher focuses only when HYPRLAND_INSTANCE_SIGNATURE is set. Give the mocked focus check its own signature and clear the earlier focus log, so it exercises the declared class in plain shells as well as compositor sessions. Co-Authored-By: GPT-6 (reasoning effort not exposed) <noreply@openai.com> Co-Authored-By: Opus 5.5 High <noreply@anthropic.com>
|
Pushed ef76802 and 378e9ed to resolve the new conflict with On a disposable Omarchy worker, the wrapped Chromium launch opens no window on GPT-6 in Codex (reasoning effort not exposed) checked the change. Opus 5.5 High found that the new focus test depended on an inherited session variable; the test now supplies its own signature and clears its earlier log. It passes with the inherited variable removed and fails with that correction reverted. Opus is credited as co-author. Opus 5.5 High and muse-wonder via pi, thinking high found no remaining actionable defect in the final review. Their agreement is not guaranteed to be independent. The updated #17134 was compared again; its shared-parser and resolver checks are already included and credited in 8f78699, while its environment-aware singleton shortcut remains an optional performance change. Greptile’s completed review of this head repeats the existing finding: the private-flag probe still loses an env wrapper’s PATH or working directory. That limitation, the parser scope and the choice among the open fixes remain with the maintainer. The captures show the same launch attempt on the base and this head. They establish that this wrapped command opens the local page; they do not establish private-window behavior. |
|
The CI follow-up checked run 45559203351 at the published head, A locally prepared merge, GPT-6 in Codex (reasoning effort not exposed) read the resolution and ran these checks. The Opus 5.5 High review process was terminated with exit 143 before producing a report; a subsequent availability ping answered, but no second opinion reviewed this merge. Nothing was pushed. The conflict and the existing private-probe/parser-scope decisions remain with the maintainer. The captures compare today's base with the locally prepared, unpushed merge. They establish that this wrapped command opens the local page; they do not establish private-window behavior. |
|
GPT-6 in Codex (effort undisclosed) read both launchers and the linked reports and classified this as a bug fix. On current The published head |








Summary
omarchy-launch-webapp/omarchy-launch-browseronly took the firstExec=token, so wrappers likeExec=/usr/bin/env LIBVA_DRIVER_NAME=iHD brave %Uranenvwith--app=and failed silently.env/flatpak/*=*tokens to find the real binary for--helpprobing.Fixes #10988
Related: #11718
Test plan
bash test/shell.d/launch-browser-test.sh(stock fail → patch pass)bash test/shell.d/launch-webapp-test.sh(stock fail → patch pass)research/pr-verify/10988.mdon the bughunt machineFixes #11718
Fixes #17074