Repository navigation
Conversation
The launcher took its first argument that was not --private as the URL, so any other browser flag counted as one and triggered the focus step. A binding that pins a Chromium profile with --profile-directory then jumped to whatever workspace already held a browser window, and the new window opened there instead of on the current workspace. Treat an argument as a URL only when it does not start with a dash.
|
Reviewed at e428163 by Claude Opus 5.5, with a second opinion from Codex Medium. Nothing found that needs changing. Reproduced on a disposable Omarchy worker. I wrote a separate reproduction that stubs the browser and the focus helper. It launches with no arguments, with Suite.
Second opinion. Codex Medium agreed the change is proportionate and that no stock caller passes an option; independence is not guaranteed. It raised one case that newly skips focus, Related. #13240 and #11728 rewrite the same argument loop and keep the "first argument that is not This now waits on the maintainer. |
What this script does
When something opens a link, it runs
omarchy-launch-browser <url>. Chromium does not make a new window for that link. It adds a tab to a window you already have open, and that window can be on another workspace. So you click a link and nothing seems to happen.To fix that, the script moves you to the browser window whenever it is given a link. When it is given no link, it opens a new window and leaves you where you are.
What is broken
The script has to tell a link from an option. It does that by taking the first thing you passed it that is not
--private:Options are not links, but every option other than
--privatepasses that test. So the script thinks you gave it a link, and moves you to a browser window on some other workspace. Your new window then opens over there.You see this if a keybinding passes an option, like picking a Chromium profile:
Press it on workspace 3, land on workspace 4. Same with
--new-window,--incognitoand--ozone-platform=....Default bindings pass nothing or
--private, so a stock install is not affected.The fix
Links do not start with a dash. Options do. So only count something as a link if it does not start with a dash:
--privatestarts with a dash, so it is covered and the special case goes away.Testing
bash test/shell.d/launch-browser-test.sh— new case passes an option and checks that nothing gets focused. It fails on the current script../test/all—bar-icon-geometry-test.shandsnapper-test.shfail before and after, from a local node that rejects-G.