Skip to content

Resolve wrapped desktop Exec= in browser and webapp launchers - #12533

Open
paulogeyer wants to merge 10 commits into
omacom:quattrofrom
paulogeyer:fix/10988-wrapped-browser-exec
Open

paulogeyer wants to merge 10 commits into
omacom:quattrofrom
paulogeyer:fix/10988-wrapped-browser-exec

Conversation

@paulogeyer

@paulogeyer paulogeyer commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • omarchy-launch-webapp / omarchy-launch-browser only took the first Exec= token, so wrappers like Exec=/usr/bin/env LIBVA_DRIVER_NAME=iHD brave %U ran env with --app= and failed silently.
  • Parse the full Exec line (strip field codes) into argv and launch with that array so env assignments and the real binary are preserved.
  • Browser private-window detection still skips env / flatpak / *=* tokens to find the real binary for --help probing.

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)
  • Local verify note: research/pr-verify/10988.md on the bughunt machine

Fixes #11718

Fixes #17074

@llstrk

llstrk commented Sep 25, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Verified: the issue #10988 case now works in both launchers, and stock browser entries behave exactly as before. With Exec=/usr/bin/env LIBVA_DRIVER_NAME=iHD brave %U:

Launcher Base Head
omarchy-launch-webapp /usr/bin/env --app=URL (fails) /usr/bin/env LIBVA_DRIVER_NAME=iHD brave --app=URL
omarchy-launch-browser /usr/bin/env URL, focus ^env.*$ /usr/bin/env LIBVA_DRIVER_NAME=iHD brave URL, focus ^brave.*$

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 --private-window and an env-wrapped Edge gets --inprivate. In the webapp launcher, extra caller arguments after the URL keep their order. The PR's own tests fail on base and pass on head, as described.

Two problems remain in wrapped forms other than env VAR=value, plus a gap in the new tests.

Other wrappers pick the wrong browser token: private windows open as normal windows, and focus can jump to an unrelated window

bin/omarchy-launch-browser picks the first token that is not env, flatpak, run or NAME=value. That token drives both the --help private-flag probe and the focus pattern. For other wrappers it lands on something that is not the browser:

Default browser Exec line (user override) Request Head result
prime-run firefox %u --private probes prime-run --help, launches prime-run firefox --incognito
Flatpak export line copied to ~/.local/share/applications (flatpak run … --command=firefox --file-forwarding org.mozilla.firefox @@u %u @@) --private probes --file-forwarding --help, launches … org.mozilla.firefox @@u @@ --incognito
Same Flatpak line, or env -u VAR chromium %U URL launches, then basename gets an option-like token (--file-forwarding, -u), prints nothing, and the focus pattern becomes ^.*$

Firefox 156 treats --incognito as an unrecognized flag and opens a normal window (BrowserContentHandler.sys.mjs). omarchy-hyprland-focus-app focuses the first client whose class matches, and ^.*$ matches any window.

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 flatpak among the handled wrappers, though, and a quiet non-private window is a worse failure than a visible one. The Firefox and focus outcomes come from source. The launcher arguments and focus patterns come from sandboxed runs with mocked launch and focus commands.

Suggested change: skip option tokens (-*) when selecting the binary, take the --command= value for flatpak run, call basename -- "$browser_exec", and skip the focus call when no plausible browser binary is found.

Quoted Exec arguments are split into broken arguments

read -r -a splits on whitespace and keeps literal quotes. The Desktop Entry spec requires double quotes around arguments that contain spaces. Exec=brave "--user-data-dir=/tmp/a b" %U now launches as:

base: brave URL
head: brave '"--user-data-dir=/tmp/a' 'b"' URL

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 NAME=value inside an env wrapper also breaks, so the wrapped form this PR targets fails there too.

Suggested change: unquote Exec arguments as the spec defines (double quotes with backslash escapes, %% as a literal %) without eval. If that is out of scope, state that quoted Exec arguments are unsupported.

Optional test improvement: both new mocks log "$*", which erases argument boundaries. Three mutants still pass the PR tests: a browser launcher and a webapp launcher that pass the whole Exec line as one argument, and a webapp launcher that puts --app=URL before the executable. ! grep -E '^--app=' in launch-webapp-test.sh can never match, because every logged line starts with -- . The uwsm-app mock added to launch-browser-test.sh is never called, because the systemd-run mock records instead of executing. Logging one argument per line (printf '%s\n' "$@") and comparing exact lines would catch all three mutants.

Flatpak scope note: Flatpak browsers export desktop files under ~/.local/share/flatpak/exports/share/applications and /var/lib/flatpak/exports/share/applications, and neither launcher searches there. Separately, the webapp allowlist does not match Flatpak IDs such as com.brave.Browser.desktop, so web apps fall back to chromium.desktop. Both limitations exist on base too. They mean the wrapper handling only applies to Flatpak lines copied into ~/.local/share/applications, and a default Flatpak browser now exits silently (status 1) from omarchy-launch-browser. A short stderr message on those exit 1 paths would help with the silent failures described in #10988.


Review information

Test scope: source review of both launchers, their in-repo callers and omarchy-hyprland-focus-app, plus the Desktop Entry spec, uwsm, flatpak 1.18.3, Firefox 156.0.1 and Chromium sources. Sandboxed runs compared base and head across 31 synthetic Exec lines with mocked systemd-run, uwsm-app, browser and focus commands, ran the PR's tests on head and base, and ran mutation checks. No browser window, compositor or user systemd session was started. Stock Exec lines for Edge, Vivaldi and Opera were not checked.

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.

@omarchybot

Copy link
Copy Markdown
Collaborator

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:

  • a30c92a merges current quattro, which had reworked both launchers around omarchy-cmd-default-browser and omarchy-cmd-browser-handoff since this branch was cut. That rework was the conflict. The launchers now hand the whole Exec argv to the handoff, so a wrapped line reaches it as env, the handoff declines it, and the wrapper runs as the entry wrote it. Stock entries hand off exactly as before.
  • 0600d1f unquotes the Exec line the way the Desktop Entry spec does. read -r -a kept the quotes, so Exec=brave "--profile-directory=Work Profile" %U became two junk arguments where quattro had simply ignored them. The commit also keeps %% as %, and it skips option tokens when picking the browser binary, because an option such as -u made the focus pattern ^.*$, which matches any window. The tests now log one argument per line and compare the whole command.

What was checked. On quattro, Exec=/usr/bin/env LIBVA_DRIVER_NAME=iHD brave %U makes the web app launcher run /usr/bin/env --app=URL, where env exits 125. The browser launcher runs /usr/bin/env URL and focuses ^env.*$. At this head they run /usr/bin/env LIBVA_DRIVER_NAME=iHD brave --app=URL and /usr/bin/env LIBVA_DRIVER_NAME=iHD brave URL and focus ^brave.*$, while Exec=brave %U launches exactly as before. Both new tests fail on quattro and fail on the merge without the unquoting commit. Both pass at this head. ./test/cli and ./test/shell ran on the worker as well. Their remaining failures, eight shell test files and one CLI check, fail the same way on unmodified quattro on the same worker. One of them is launch-browser-test.sh, which needs the checkout's helpers on PATH (#13561).

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:

  • env -u NAME firefox and flatpak run still probe the wrong token for the private flag and focus.
  • A --class in the Exec line changes the window class that the focus pattern looks for.
  • %c, %k and %i are dropped rather than expanded.

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 env itself. Which one lands is the maintainer's decision.

This closes #10988 and #11718, and is now waiting on the maintainer.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[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

  1. P1 Private launches lose wrapper settings ▶

Summary

Browser and web-app launches now preserve the complete desktop-entry command.

  • Browser launches keep the full desktop-entry command and its wrappers.
  • Browser lookup checks the command wrapped by env.
  • Web-app launches keep the browser command and add the app URL.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Default-browser lookup] --> B[Shared desktop-entry parser]
  C[Browser launcher] --> B
  D[Web-app launcher] --> B
  B --> E[Complete command and arguments]
  E --> F{Running-browser handoff accepted?}
  F -->|Yes| G[Running browser receives arguments]
  F -->|No| H[Launch complete command]
Loading

Reviews (10) · Last reviewed commit: "Make the CRLF launcher check independent..." · Reviewed by Greptile

Comment thread bin/omarchy-launch-browser Resolved
Comment thread bin/omarchy-launch-webapp Resolved
@jandrusk

Copy link
Copy Markdown

Good fix for env/flatpak-wrapped Exec= lines, with tests. Clean merge. Related webapp launcher work also in #12522 (draft), #14757, #14200, #14163 — this one looks ready on its own.

@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 13, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Brought this up to date with quattro and reviewed it again, by Claude Opus 5.5 with Codex Medium as second opinion. I pushed two commits to this branch:

  • a028d6e merges current quattro. Since the last merge, quattro makes omarchy-launch-browser probe the browser's private-window flag only for --private launches (Probe the browser's private-window flag only for private launches #15037), and that was the conflict. The merge keeps it, and probes the browser the Exec line wraps rather than its first token. The test now also checks a wrapped --private launch.
  • 3ee5c23 fixes three cases where this branch broke a desktop entry that launches on quattro, which ignores every Exec argument. Dropping %c and %k left an option such as --name %c holding the URL, so they are now expanded to the entry's Name= and the desktop file's path, as the Desktop Entry spec says, with Name= decoded the same way as Exec=. A -- in the Exec line turned the launcher's own --app= or private flag into an operand: Exec=chromium -- %U ran chromium -- --app=URL. A standalone -- is now dropped. env -u NAME firefox made NAME the binary the private flag was probed on, so the scan now skips the values of env's -u and -C.

What was checked, on a disposable Omarchy worker:

  • The bug. The default browser's entry was set to Exec=/usr/bin/env OMABOT_WRAPPED=1 /usr/bin/chromium "--user-data-dir=/tmp/x QQZprofile" %U. On quattro, the browser launcher starts nothing, and the web app launcher exits 125 with env: unrecognized option '--app=…'. At this head, Chromium starts with the quoted profile directory as one argument and the URL, and the web app opens as an app window.
  • The -- case. With Exec=/usr/bin/chromium --user-data-dir=… -- %U, the merge alone ran Chromium with -- --app=URL. This head runs it with --app=URL.
  • The tests. Both launcher tests fail with the launchers reverted to quattro's, and the new cases fail with the launchers reverted to the merge alone. All of them pass at this head.
  • The suite. ./test/cli passes. ./test/shell has 9 failing tests across 13 files at this head. quattro on the same worker fails the same 13 files, with 10 failing tests: the extra one is launch-browser-test.sh, which needs the checkout's helpers on PATH (Run the browser launcher test against the checkout's helpers #13561). Nothing fails here that passes on quattro.

Second opinion. Codex Medium agreed the merge resolution loses nothing from either side. It raised the %c/%k, -- and env -u cases above, and then a -- followed by a fixed operand and the escapes in Name=, which this head also fixes. Its last round on this head found nothing. Its independence is not guaranteed. Asked to choose between this pull request and #13240/#13241, it chose this one, which is also the older. #13240 still probes and focuses env for a wrapped Firefox, and probes on every launch, which undoes #15037. Neither newer pull request is clearly better.

Not covered. For a flatpak run line, the probe looks for a binary that exists only inside the sandbox, so a private Flatpak Firefox window gets --incognito. prime-run-style wrappers have the same gap, and %c uses the untranslated Name=. None of these entries launched at all on quattro.

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.

@omarchybot

Copy link
Copy Markdown
Collaborator

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. launch-browser-test.sh now runs a default browser of userapp-Firefox Developer Edition-U5J9W3.desktop, and launch-webapp-test.sh runs brave-browser Work.desktop. The launchers are unchanged.

What was checked, on a disposable Omarchy worker:

  • The new cases. Run on their own, each fails with quattro's launchers, which split the id and find no Exec= line, and passes at this head. The full launcher tests pass at this head, 8/8 and 3/3.
  • The suite. I merged current quattro (be54892) into this head locally, without pushing it, and ran the suite on that merge. ./test/cli passes. ./test/shell fails the same 8 files that quattro fails on the same worker. Two more files failed once on the merge, t3code-install-test.sh and windows-vm-compose-test.sh. Both pass on a rerun, and t3code-install-test.sh also failed once on quattro.

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 quattro, and leaks no mock into another case. They also found that #16226 fixes nothing for this bug that this pull request lacks. Since they agree with my reading, their independence isn't guaranteed. #16226's notification for a missing browser command was left out, because #13710, #14200 and #15837 handle that same case in different ways.

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.

@SorenHJohansen

SorenHJohansen commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Ran this branch (658941673a1d, base quattro) against a Flatpak default browser on Omarchy 4.0.6-1. It stops before your Exec= handling.

Default browser com.vivaldi.Vivaldi.desktop, Flatpak Vivaldi 8.2.4133.94:

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

bin/omarchy-launch-webapp https://example.com exits 1, no window:

+ case $browser in
+ browser=chromium.desktop
+ desktop_exec_argv chromium.desktop
+ return 1

The desktop id gate predates this branch. A reverse-DNS id does not match it, so browser becomes chromium.desktop and desktop_exec_argv has nothing to parse:

 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
+fi

Your parsing is fine, it is not reached. omarchy-launch-browser has no gate and works through your change here, so only the web app launcher is affected. No patch request.

With the gate skipped your argv (... @@u @@ ... --app=<url>) opens a real app window, WM_CLASS vivaldi-example.net__-Default. Appending --app= after the parsed argv is right for Flatpak web apps.

#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>
@paulogeyer
paulogeyer force-pushed the fix/10988-wrapped-browser-exec branch from 6589416 to 676d138 Compare October 31, 2026 12:15
@paulogeyer

Copy link
Copy Markdown
Contributor Author

Thanks @SorenHJohansen, that's a clear trace, and good to know the parsed argv plus --app= opens a real web app window under Flatpak.

The Flatpak default-browser case is out of scope here: it's the launcher's desktop-id gate, which predates this PR, not the Exec= handling this PR changes. Could you open a follow-up issue for it, linking your comparison on #11718?

I didn't fold the flatpak info guard in. As written it skips the gate for any Flatpak app, so a Flatpak Firefox default would get --app= instead of falling back to Chromium. The follow-up probably needs to match Chromium-family app ids (com.vivaldi.Vivaldi, com.brave.Browser, com.google.Chrome, ...) rather than just checking that the id is a Flatpak.

Comment thread test/shell.d/launch-webapp-test.sh Resolved
@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 31, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

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 launch-webapp-test.sh now live in launch-browser-test.sh, which already tests omarchy-launch-webapp, as Greptile pointed out and AGENTS.md asks. The two spaced desktop id cases are gone: quattro already reads Exec= from the quoted entry path, so they passed without this change.

What was checked, on a disposable Omarchy worker:

  • Real Chromium. With Exec=/usr/bin/env OMABOT_PROBE=wrapped chromium "--user-data-dir=/tmp/omabot 12533 profile" %U as the default browser, quattro's omarchy-launch-browser starts nothing, and omarchy-launch-webapp fails with /usr/bin/env: unrecognized option '--app=…'. At this head both start Chromium with the entry's quoted argument, then the URL or --app=<url>.
  • The tests. launch-browser-test.sh passes at this head, 12/12. With either launcher reverted to quattro, its new cases fail.
  • The suite. ./test/cli passes. ./test/shell fails 6 files (agent-account-exec, ascii, branding-about-animation, first-run, i18n, runtime-smoke), and all 6 fail the same way on the merge base 037b104 without this change.

Second opinion. Codex Medium and muse-wonder at high thinking reviewed this head and found no regression from quattro. Wrapped entries reach omarchy-cmd-browser-handoff with env or flatpak as the first word, so the handoff refuses them and the whole command is launched. Both reviewers raised one maintenance concern, which I confirmed. The ~75-line desktop_string/desktop_exec_argv parser is copied verbatim into both launchers, so every later fix has to be made twice. Moving it into one hidden helper that both launchers source would fix that. #17134 does this with bin/omarchy-cmd-browser-exec.

Some gaps are already on quattro and are left as they were: a Flatpak or env -S entry still picks the wrong private flag, and omarchy-cmd-default-browser still treats env as the installed browser when the browser behind it has been removed. #17134 fixes that resolver part of #17074, so merging this one alone closes #17074 with that part still open.

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 flatpak run, and keeps the XDG data dir lookup. #16998 changes the private-flag probe in the same lines. It doesn't compete with this, but one of the two will need a rebase after the other lands.

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.

omarchybot and others added 2 commits November 1, 2026 14:37
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>
@omarchybot

Copy link
Copy Markdown
Collaborator

I pushed two commits to bin/omarchy-launch-browser and its test, 8f56344 and 6a713fc. They carry over the one thing #13240 handled better, crediting @Raj-Jagadeesh-A-P as co-author. #13240 was compared against this pull request and the other open fixes for #11718, and this one stays the fix to bring forward, being the oldest.

What was wrong: for a Flatpak default browser (Exec=flatpak run … org.mozilla.firefox @@u %u @@) the launcher took the app id org.mozilla.firefox as the browser and ran it with --help to choose the private flag. It isn't a command on the host, so a private launch of a Flatpak Firefox got --incognito and opened a normal window. For Exec=env -S "MOZ_ENABLE_WAYLAND=1 firefox" %u it probed env itself, with the same result.

What changed: a Flatpak's private flag now comes from its app id without running anything: --private-window for Firefox, LibreWolf, Zen, Waterfox and Floorp, --inprivate for Edge, --incognito otherwise. That also works when the flatpak run sits behind env. The words of an env -S string are split with the same quoting env uses, and the browser is found among them. Only the private flag and the window to focus depend on this. The command that gets launched is still the whole Exec= line, unchanged.

What was checked, on a disposable Omarchy worker: launch-browser-test.sh passes 14/14 at 6a713fc. Both new cases fail with this branch's launcher from before these commits and with quattro's, and the quoted env -S case also fails if the string is split on whitespace alone. ./test/cli is green. The shell suite fails the same 6 files that fail on the merge base, 037b104, so none of them come from this change. These cases ran against stub browsers. The real-Chromium launch checked at 5a0be24 covers the launched command line, which these commits don't touch.

Second opinion: Codex Medium and muse-wonder (via pi, thinking high) reviewed the commits over three rounds. Between them they found that splitting env -S on whitespace breaks a quoted value such as LABEL='Work Browser', that a Flatpak behind env was missed, that an assignment ending in /flatpak set off the Flatpak path, and that an empty -S string stopped the search. All four are fixed in 6a713fc, which names both as co-authors. The last round found nothing. Flatpak options that take their value as a separate word (--branch stable) and env -S escapes such as \_ or ${VAR} were not handled before this pull request and still aren't.

Still open: omarchy-cmd-default-browser's installed(), which #17074 also mentions, still checks only the first word of Exec=. So an env-wrapped entry whose browser has been uninstalled still counts as installed. #17134 carries a fix for that. The ask from the last comment still stands: share the Exec= parser between omarchy-launch-browser and omarchy-launch-webapp rather than keeping two copies. Once that is done, the maintainer chooses among the competing fixes for #11718.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Nov 16, 2026
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>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Nov 17, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This pull request had started conflicting with quattro in bin/omarchy-launch-webapp. Since it was last reviewed, b10da7e and 351812c changed the web app fallback for a default browser that isn't Chromium-based: it now tries google-chrome.desktop first, then chromium.desktop. I merged quattro into the branch as a01a184 (a merge commit, not a rebase), and it merges cleanly again.

How the conflict was resolved: the web app launcher keeps quattro's list (a Chromium-family default on its own, otherwise Chrome, then Chromium) and runs this branch's Exec= parser over it. It takes the first entry the parser gets a command from, and the empty-command guard now checks the parsed arguments instead of the first word. One small difference from quattro: a Chrome entry with an empty Exec= now falls through to Chromium instead of showing the error. quattro's two new fallback tests were changed only to read the launch log one argument per line, which is how this branch's mocks write it.

What was checked, on a disposable Omarchy worker: launch-browser-test.sh passes 15/15 at a01a184. It fails with quattro's two launchers (wrapped Exec= line), with only quattro's web app launcher (env-wrapped web app), and with this branch's web app launcher from before the merge (Chrome over Chromium). ./test/cli is green. The shell suite fails 6 files. Five of them (ascii, branding-about-animation, first-run, provision-owner-keyboard, runtime-smoke) fail the same way on a quattro tree, and remote-session-service passes when run alone on both, so none come from this change.

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 --, including one a shell wrapper needs as $0. With Exec=sh -c "exec chromium \"\$@\"" -- %U, the URL becomes $0 and never reaches the browser. That trade-off came with dropping -- so the launcher's own options aren't read as operands. It's narrow, and I left it alone.

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 Exec= line. #17134 still builds the command from the browser word alone, which drops the entry's own flags and Flatpak's run …. Its installed() fix in omarchy-cmd-default-browser is still the part worth bringing here. #18640 and #19011 also touch omarchy-launch-browser, for other bugs.

Still open, and waiting on the author: the ask from the last two comments stands. Share the Exec= parser between the two launchers instead of keeping two copies. After that, the maintainer chooses among the competing fixes.

com.microsoft.edge) private_flag="--inprivate" ;;
*) private_flag="--incognito" ;;
esac
elif "$browser_exec" --help 2>/dev/null | grep -q MOZ_LOG; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

@omarchybot

Copy link
Copy Markdown
Collaborator

On Greptile's P1 about the private-flag probe in bin/omarchy-launch-browser, line 133: the mechanism is real, but it isn't a regression and it doesn't block this pull request.

What it does: the token scan skips the env wrapper, its assignments and -C <dir>, and then line 133 runs the bare browser token with --help in the launcher's own directory and environment. With Exec=/usr/bin/env -C /opt/firefox ./firefox %u, or Exec=env PATH=/opt/ff/bin:/usr/bin firefox %u where Firefox exists only on that PATH, the probe can't find the binary, so it falls through to --incognito. The launch then keeps the whole wrapper, so Firefox receives --incognito and opens a normal window rather than a private one.

Why it's left as it is: quattro gets both entries worse. It probes env --help and picks --incognito, then launches env alone, so nothing starts. No package Omarchy installs a browser from writes an entry like this: Chromium and Chrome use a bare or absolute command, as do Firefox, Brave, Edge and Zen. Omarchy itself writes no browser entries. Only a hand-written override that puts a Firefox-family browser behind -C with a relative command, or behind a PATH= that the launcher's own PATH lacks, reaches it. The existing tests don't cover it, since their mock browser is already on PATH.

If you take it on while sharing the parser: record where the scan found the browser, and probe through the wrapper with "${tokens[@]:0:browser_index+1}" --help instead of "$browser_exec" --help. That replays -C, assignments and -S without parsing anything new. The cost is that anything the wrapper does before the browser also runs during the probe.

Who checked: I traced both entries against the head (a01a184) and quattro (3b36b9e). Codex Medium and muse-wonder (via pi, thinking high) did the same, and both concluded it should be reported rather than fixed here. Their agreement isn't guaranteed to be independent of mine. The head hasn't moved since the last comment, and CI is now green, so the worker results there still stand.

Still waiting on the author: share the Exec= parser between the two launchers. After that, the maintainer chooses among the competing fixes.

@omarchybot

Copy link
Copy Markdown
Collaborator

One more case for the shared parser, in bin/omarchy-launch-browser line 97: the wrapper scan reads -u as env -u NAME, which takes an argument, even after flatpak run, where -u means --user and takes none. With Exec=flatpak run -u org.mozilla.firefox %u, the scan skips the app id and finds no browser. A private launch then probes flatpak --help and passes --incognito, so Firefox opens a normal window instead of a private one. Ordinary launches aren't affected, because the whole command is still run. No Flatpak export writes -u (they use --branch=stable --arch=… --command=… --file-forwarding), so only a hand-written entry hits this, and quattro is worse there: it launches a bare flatpak. It doesn't block the pull request. When the parser moves into a shared helper, treat options according to the wrapper they follow, so that env takes -u NAME and flatpak run doesn't.

Who checked: Codex Medium found this, and I confirmed it by reading the code at a01a184 against quattro 3b36b9e. Nothing was run for it, since the head and base haven't moved since the worker results in the earlier comments. I also compared #13241 again at its new head c94f4b9. Its latest commit only merges quattro, keeping quattro's Chrome-then-Chromium fallback around the same parser, so the comparison in the earlier comments still holds.

Still waiting on the author: share the Exec= parser between the two launchers. After that, the maintainer chooses 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>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review and removed verified Omarchy Triage has verified that this issue is ready for final review labels Nov 18, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Pushed 8f78699 to bring in #17134’s shared-parser pattern and resolver checks, crediting @sundarshahi. Both launchers and omarchy-cmd-default-browser now use one copy of the existing full Exec= parser. For a plain env VAR=VALUE browser entry, the resolver checks the browser on the entry’s PATH, so an uninstalled browser no longer counts as installed merely because env exists. Flatpak entries still check the host wrapper, and the launchers retain the complete command and its arguments. Entries using env options retain their previous availability check.

On a disposable Omarchy worker, the removed-browser reproduction fails with both quattro’s resolver and this branch’s pre-fold resolver, passes at the new head, and fails with the fix reverted. The lookup checks pass 4/4 and launcher checks 15/15; the CLI suite and browser handoff, link handoff, default-apps and OpenClaw checks pass. The final shell suite fails 5 of 427 files, with skipped checks in 6 files: ascii, branding-about-animation, provision-owner-keyboard and runtime-smoke also fail on the base; agent-account-copy passes when run alone on both base and head. The full suite remains red.

GPT-6 High in Codex reviewed the change. Opus 5.5 High found that an attached env option containing = could be mistaken for an assignment; that is fixed, and its regression case fails with the correction reverted. Opus 5.5 High and muse-wonder via pi, thinking high found no actionable code issue in the final round. Their agreement is not guaranteed to be independent of mine.

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.

Before: the old resolver selects the removed browser and no window opens

After: the resolver skips the removed browser and Chromium opens the local test page

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Nov 20, 2026
…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>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Nov 22, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Pushed 18c292f to resolve the conflict with quattro after #18640 landed. The shared parser now returns the desktop file it selected, and the browser launcher reads StartupWMClass from that same file. This preserves the declared window class and binary-name fallback while retaining the full wrapped command.

On a disposable Omarchy worker, the wrapped Chromium launch opens no window on quattro at d99df1d, opens the local test page at this head, and fails again with the launchers and resolver reverted. The existing declared-class test passes at this head and fails with the pre-merge launcher restored. The CLI checks pass 136/136, launcher checks 15/15, resolver 4/4, handoff 2/2, link handoff 5/5, and default-app checks 21/21. The full shell suite fails 4 of 438 files: ascii, branding-about-animation, provision-owner-keyboard and runtime-smoke. All four fail on the base too; six files contain skipped checks.

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 env -S support and Flatpak private-flag table, and this pull request still waits on that decision. The full suite remains red.

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.

Before: the base selects the wrapped entry but no browser window opens

After: Chromium opens the local test page through the wrapped entry

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Nov 23, 2026
omarchybot and others added 2 commits November 25, 2026 07:05
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>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Nov 25, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Pushed ef76802 and 378e9ed to resolve the new conflict with quattro. The shared reader now reads Exec, Name and StartupWMClass with one builtin loop and strips CRLF carriage returns before parsing. This keeps the current MIME-list search order, data-dir lookup and quoted execution from #19905/#19965 while preserving the complete wrapped command. The added CRLF check covers arguments, the decoded name and the declared window class.

On a disposable Omarchy worker, the wrapped Chromium launch opens no window on quattro at a3bad0b, opens the local page at this head, and opens nothing with the base launchers/resolver restored. Restoring the previous helper and browser launcher also makes both new CRLF checks fail. CLI checks pass 141/141; launcher checks 16/16, resolver 4/4, handoff 2/2, link handoff 5/5 and default-app checks 22/22 pass. The final full shell suite fails 3 of 257 files: provision-owner-keyboard and runtime-smoke also fail on the base, while remote-session-service passes when run alone on both versions. Three files contain skipped checks. The full suite remains red. GitHub’s compositor shard also fails a wallpaper-sampling assertion in runtime-smoke-test.sh; that test and the shell code it exercises are unchanged by this pull request.

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.

Before: the base resolves the wrapped desktop entry but no Chromium window opens

After: Chromium opens the local page through the preserved wrapped command

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Nov 25, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

The CI follow-up checked run 45559203351 at the published head, 378e9ed547. Its tested merge has exactly the same tree as that head. On a fresh Omarchy worker, runtime-smoke-test.sh passes the wallpaper-sampling assertion that failed in CI, then fails later at “keepLoaded fixture service IPC responds.” The same later failure occurs on today's quattro, e33c5a8fe2. That base's compositor job has passed; this does not establish what caused or fixed the original CI assertion.

A locally prepared merge, 228d1991db (unpushed), keeps quattro's exact --private argument handling alongside the complete wrapped command. The inherited URL-preservation check fails against the published launcher and passes with that resolution. On the worker, launcher checks pass 17/17, browser lookup 4/4, handoff 2/2, link handoff 5/5, default-app checks 22/22 and CLI checks 143/143. A real Chromium launch opens no window on today's base, opens the local page with the candidate merge, and opens no window with the base launchers restored. The candidate files were restored and their hashes checked afterward. The full-suite attempt cannot start its test compositor: headless-output verification reports a zero-size output, so the full shell suite has not run successfully.

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.

Before: today's base starts no Chromium window through the wrapped desktop entry

After: the unpushed candidate merge opens the local page through the wrapped entry

@omarchybot

Copy link
Copy Markdown
Collaborator

GPT-6 in Codex (effort undisclosed) read both launchers and the linked reports and classified this as a bug fix. On current quattro, both launchers still take only the first word of Exec=, so an env wrapper loses the browser command it is supposed to run. DeepSeek V4.1 Flash via pi (default effort) classified the same diff as an enhancement. The diff also expands desktop-entry field codes and adds private-window flag selection for Flatpak browsers, so the scope needs a maintainer decision.

The published head 378e9ed547 conflicts with current quattro in the browser launcher and its test. This was a source and classification review. The worker checks were last run in the November 26 follow-up.

@omarchybot omarchybot removed the bug Something isn't working label Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants