omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

omarchy font set prints omarchy-notification-send usage error when the font name contains a space

Open TheRealGhost007 opened this issue 2 months ago • 5 comments

What happened

$ omarchy font set "Fira Mono"
15887
Usage: omarchy-notification-send [--app-name <app-name>] [-g <glyph>] [-u <low|normal|critical>] [-i <icon>] [-t <ms>] [-r <id>] [-p] [--image <path-or-uri>] <headline> [description] [--exec <program> [args...]]

The font does get set correctly despite the error - confirmed:

$ omarchy font current
Fira Mono

So this is cosmetic, not functional, but it's a real parse/quoting bug: the script's internal call to omarchy-notification-send isn't passing the multi-word font name through correctly, so that one sub-call fails and dumps its own usage text to the terminal.

What was expected

No error output - font names with spaces are common (most Google/Nerd Fonts have them) and omarchy font list itself lists plenty, e.g. "Fira Mono", "DM Mono", "Google Sans Code".

Steps to reproduce

omarchy font set "Fira Mono"

Single-word font names (e.g. omarchy font set FiraCode) don't show this.

System details

  • Omarchy: 4.0.2-1, stable channel
  • Kernel: 7.1.9-arch1-2

TheRealGhost007 avatar Sep 04 '26 07:09 TheRealGhost007

Reproduced on the same version (Omarchy 4.0.2-1, kernel 7.1.9-arch1-2). The symptom is exactly as described, but the cause isn't quoting — the font name never reaches omarchy-notification-send at all. There are two independent defects in bin/omarchy-font-set (lines 76-82 on quattro):

if pgrep -x ghostty; then
  omarchy-notification-send -g  "You must restart Ghostty to see font change"
fi

if pgrep -x foot; then
  omarchy-notification-send -g  "You must restart Foot to see font change"
fi

1. The stray number is pgrep's stdout. pgrep -x ghostty isn't redirected, so it prints the matched PID before the if body ever runs. Your 15887 was Ghostty's PID.

2. The usage error is a missing -g argument. -g takes a value — in omarchy-notification-send, -g | --glyph) glyph=$val consumes the next argument. Note the double space after -g: a glyph literal appears to have been lost at some point, so the message string is consumed as the glyph and no headline is left, which is precisely what triggers the usage text.

Both reproduce with no font involved:

$ pgrep -x ghostty
6781

$ omarchy-notification-send -g  "You must restart Ghostty to see font change"
Usage: omarchy-notification-send [--app-name <app-name>] [-g <glyph>] ... <headline> [description] ...
$ echo $?
1

$ omarchy-notification-send -g "󰛖" "You must restart Ghostty to see font change"
$ echo $?
0

The real trigger is Ghostty or Foot running, not a space in the font name. Both lines sit after the font has already been written, so they fire for every successful omarchy font set.

The single-word observation is, I think, a red herring: the earlier fc-list | grep -Fqi -- "$font_name" gate exits with "Font 'X' not found." before reaching these lines, and almost no monospace family has a single-word name — FiraCode isn't an installed family on either of our systems (the installed one is FiraCode Nerd Font), so that call never got far enough to hit the bug.

Worth reclassifying as functional, not cosmetic. Because -g eats the message, the "You must restart Ghostty/Foot to see font change" notification is never delivered to anyone — the one hint that the running terminal needs a restart is silently lost, and only Ghostty/Foot users are affected, which is exactly who needs it. omarchy-font-set has no set -e, so the failure is swallowed and omarchy font set still exits 0.

Suggested fix — redirect pgrep and give -g a glyph:

if pgrep -x ghostty >/dev/null; then
  omarchy-notification-send -g "󰛖" "You must restart Ghostty to see font change"
fi

if pgrep -x foot >/dev/null; then
  omarchy-notification-send -g "󰛖" "You must restart Foot to see font change"
fi

ahiggins1039 avatar Sep 07 '26 07:09 ahiggins1039

Correction to my comment above: I checked for duplicates against repo:basecamp/omarchy, which silently returns nothing now that the repo has moved to omacom/omarchy. Searching the canonical name turns up prior art I should have cited.

The -g half is already correctly diagnosed in #7183, filed 2026-08-16, with the same root cause and the same reduced repro. A maintainer has taken it and opened PR #7370, which drops -g so the sentence becomes the headline. Credit there, not here.

The pgrep half is not covered by either. #7183 doesn't mention pgrep and PR #7370 leaves both calls untouched:

 if pgrep -x ghostty; then
-  omarchy-notification-send -g  "You must restart Ghostty to see font change"
+  omarchy-notification-send "You must restart Ghostty to see font change"
 fi

So when #7370 lands, the notification will fire correctly — but the bare PID this issue opens with will still print on every omarchy font set with Ghostty or Foot running, because pgrep -x ghostty is still writing its match to stdout. This issue would look "fixed but not really": the usage error goes away, the stray number stays.

That leaves a one-line addition worth folding into #7370:

if pgrep -x ghostty >/dev/null; then

and the same for the foot branch. pgrep -q is not portable to procps-ng, so >/dev/null is the safe form.

The "font name contains a space" framing in the title is still worth correcting for anyone searching: neither defect involves the font name, which is never passed to omarchy-notification-send. The trigger is Ghostty or Foot running. Single-word names appear immune only because the earlier fc-list | grep -Fqi -- "$font_name" gate exits first — almost no monospace family has a single-word name, so those calls never reach line 76.

ahiggins1039 avatar Sep 07 '26 07:09 ahiggins1039

Checked against quattro (d74d6ea24). There are two bugs here, and the space in the font name causes neither; the trigger is Ghostty or Foot running.

  • The stray number is the terminal's PID: if pgrep -x ghostty; then and if pgrep -x foot; then (bin/omarchy-font-set:76,80) print their match to stdout.
  • The usage text comes from omarchy-notification-send -g "You must restart …" (bin/omarchy-font-set:77,81): -g takes the sentence as its glyph, no headline is left, and it prints usage and exits 1, so the restart notice is never shown. font-set has no set -e, which is why the font is still set.

#10160 fixes both halves and already declares that it closes this issue. It was reproduced on a worker earlier: on quattro with Foot running, omarchy font set printed the PID and the usage text and sent nothing; on its head it was quiet and sent the notice. Other open pull requests fix the same lines; #7370 and #13737 fix only the notification and would leave the PID printing. Which one lands is the maintainer's call, so this waits on them.

Diagnosis by Claude Opus 5.5; Codex Medium reviewed it independently of the reproduction and reached the same mechanism and the same reading of which pull requests cover both halves (it had access to this session's notes, so agreement is not proof of independence).

omarchybot avatar Oct 11 '26 04:10 omarchybot

The usage dump came from an empty -g swallowing the headline. #15326 restored the glyph and passes the localized headline as one quoted argument, so a font name that contains a space no longer reaches omarchy-notification-send as its own arguments.

The PID line in the reproduction is #12596.

calledtoconstruct avatar Oct 16 '26 17:10 calledtoconstruct

Checked again against quattro (33783b170) after the comment above. Half of this is fixed there and half is not.

  • The usage text is gone. Since #15326, both restart calls in bin/omarchy-font-set:77,81 pass a real glyph (U+E659, which renders invisibly in most fonts) to -g, so the localized "You must restart … to see font change" becomes the headline and the notice is sent. #7370 and #13737 fix only this half, so they no longer fix anything on quattro.
  • The stray number still prints. if pgrep -x ghostty; then and if pgrep -x foot; then (bin/omarchy-font-set:76,80) write the running terminal's PID to stdout on every omarchy font set while Ghostty or Foot is open.

The space in the font name plays no part in either. #10160 now changes exactly those two pgrep lines to redirect to /dev/null, which is what remains of this issue; #12600 does the same but conflicts with quattro since #15326. #10160 declares that it fixes #12596, the later report of this same bug, but not this issue; linking it here was refused because #10160 has been pushed to since it was last reviewed, so that pull request goes round the queue again and is checked there. This waits on the maintainer to land the PID fix.

This was checked by reading the source at that commit, not on a worker. Diagnosis by Claude Opus 5.5; Codex Medium reviewed the same tree separately and reached the same result on both halves, including the glyph bytes (it can read this session's notes, so its agreement is not proof of independence).

omarchybot avatar Oct 16 '26 22:10 omarchybot