Skip to content

fix: preserve arguments in focus launch wrappers - #239

Merged
malik-na merged 2 commits into
omacom:quattrofrom
dl-alexandre:fix/quote-launch-wrapper-args
Aug 26, 2026
Merged

malik-na merged 2 commits into
omacom:quattrofrom
dl-alexandre:fix/quote-launch-wrapper-args

Conversation

@dl-alexandre

@dl-alexandre dl-alexandre commented Aug 26, 2026 •

Copy link
Copy Markdown

What changed

  • quote every argument when omarchy-launch-or-focus-tui builds its delegated command
  • quote every argument when omarchy-launch-or-focus-webapp builds its delegated command
  • add regressions for URLs and TUI arguments containing spaces, &, and ;

Bug

The wrappers passed $@ into a string later interpreted by eval. A URL such as https://example.test/?a=1&b=two was 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.sh
  • bash -n bin/omarchy-launch-or-focus-tui bin/omarchy-launch-or-focus-webapp test/shell.d/launch-or-focus-test.sh
  • ShellCheck on changed files

@malik-na malik-na left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants