#16136

omarchy-shell: keep a bracketed argument whole on the qs ipc fallback

Opencbayschm74wants to merge intofrom

What

The qs ipc fallback in bin/omarchy-shell expands a bracketed argument into one argument per item, so a call that passes a list as one value arrives with the wrong number of arguments. The socket path sends fields verbatim, so one call reads differently depending on which path answered.

Repro (4.0.6, where every call takes the qs ipc path)

omarchy bar set janitorhead.quotatank costLocalProviders '["claude","codex"]' --json
# Too many arguments provided (4 required but 5 were provided.)
argumentbeforeafter
["claude","codex"]two arguments ("Too many arguments provided")one value; stores the array
["only"]its element only, silently wrongone value
[]no argument at all ("Too few arguments")one value
{"a":1}, hellountoucheduntouched

Why

qs ipc call treats a [...] literal as a list and hands its items through as separate arguments (src/launch/parsecommand.cpp, the arguments option's allow_extra_args()). Omarchy's own socket protocol has no such rule: fields are unit-separated and arrive whole. omarchy-shell now appends a space to an argument shaped like a list literal before the qs ipc call, which keeps it one value; the JSON parsing on the far side tolerates the trailing whitespace, so omarchy bar set --json stores the same array the socket path and the GUI do. Arguments that are not list literals are passed through untouched.

The split itself may deserve a look upstream in Quickshell — qs ipc call --help describes the arguments as text.

Testing

  • test/shell.d/omarchy-shell-arguments-test.sh (new): stubs qs, runs the real omarchy-shell, and asserts a bracketed argument, a one-element list and an empty list each reach qs ipc as one value while other arguments are untouched.
  • ./test/all: test/cli passes. test/shell reports 21 failures on this machine that fail identically without the change (desktop/session tests such as screenrecording, screenshot, battery, i18n and default-apps, plus one cleanup race); the new test passes.
  • Verified against a running shell 4.0.6: omarchy-shell shell setBarWidget janitorhead.quotatank k '["x","y"]' '{}' stores ["x","y"]; before, it failed with the arity error.

Activity

3
greptile-apps[bot]14h ago

Confidence Score: 4/5

[Medium impact] The change reaches calls that use the shell’s IPC fallback.

The PR appears safe to merge, with a non-blocking gap in coverage of the real qs ipc parser.

Findings

  1.  Real parser goes untested ▶

Summary

The fallback in omarchy-shell now appends a space to bracketed arguments before calling qs ipc, so list values can arrive as one argument.

  • Bracketed list arguments stay whole when omarchy-shell uses qs ipc.

Reviews (1) · Last reviewed commit: "omarchy-shell: keep a bracketed argument..." · Reviewed by Greptile

greptile-apps[bot]reviewed14h ago