Repository navigation
fix: preserve arguments in focus launch wrappers - #239
Conversation
malik-na
left a comment
There was a problem hiding this comment.
Real bug: LAUNCH_COMMAND="omarchy-launch-webapp $@" is an unquoted expansion into a string that omarchy-launch-or-focus later evals, so & in a query string is a background operator and spaces/; split the command. Building the string with printf %q per argument is the matching fix for that consumer.
The regression covers the actual URL shape (?a=1&b=two words;next=three) and a TUI arg with the same metacharacters, and the setsid mock reads argv rather than a reconstructed string, so it would catch a quoting miss.
Follow-up, not blocking: bin/omarchy-launch-or-focus still does eval exec setsid $LAUNCH_COMMAND (unquoted). eval concatenates its words with spaces and re-parses, so %q output survives today, but pathname expansion runs on the unquoted expansion first. Quoting the eval argument (eval exec setsid "$LAUNCH_COMMAND") would close that remaining gap without changing the wrappers.
What changed
omarchy-launch-or-focus-tuibuilds its delegated commandomarchy-launch-or-focus-webappbuilds its delegated command&, and;Bug
The wrappers passed
$@into a string later interpreted byeval. A URL such ashttps://example.test/?a=1&b=twowas truncated at&, so common query parameters were lost. Shell metacharacters could also change the delegated command.Verification
bash test/shell.d/launch-or-focus-test.shbash -n bin/omarchy-launch-or-focus-tui bin/omarchy-launch-or-focus-webapp test/shell.d/launch-or-focus-test.sh