Skip to content

Read a text size typed with a leading zero as decimal - #16864

Open
ThatRetiredDude wants to merge 1 commit into
omacom:quattrofrom
ThatRetiredDude:display-text-size-leading-zero
Open

ThatRetiredDude wants to merge 1 commit into
omacom:quattrofrom
ThatRetiredDude:display-text-size-leading-zero

Conversation

@ThatRetiredDude

Copy link
Copy Markdown

Problem

omarchy-display-text-size checks its size with ((size < MIN || size > MAX)) and then uses the string as typed. Bash reads a number with a leading zero as octal, so:

  • omarchy display text size 09 (or 08, 019, ...) prints ((: 09: value too great for base (error token is "09") to stderr. The failed test reads as false, so the command carries on and applies the size anyway.
  • omarchy display text size 0024 reads as octal 20, passes the 9–20px range check, and then sets 24px everywhere. awk and the shell read the stored value as decimal.
  • omarchy display text size 016 writes base-size = 016 into ~/.config/omarchy/shell.toml. TOML doesn't allow leading zeros in integers.

Fix

Read the size as base 10 (10#$size) in the range check. Then store it as a plain number before it goes into shell.toml, the GTK factor and the terminal configs.

Testing

  • bash test/shell.d/kitty-config-test.sh: passes. The new case runs the real command with 016 against a temporary home and checks for base-size = 16 in shell.toml and font_size 12.0 in Kitty's config. It also checks that 0024 is rejected. On quattro it fails on base-size = 016.

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Reads zero-padded text sizes as decimal and removes leading zeros before saving settings.

  • Leading-zero text sizes are read as decimal before settings change.

Reviews (2) · Last reviewed commit: "Read a text size typed with a leading ze..." · Reviewed by Greptile

@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Nov 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and tested at 7e0f2f9. Nothing found to fix.

Reproduced on an Omarchy ISO worker with a throwaway home directory. On quattro, omarchy display text size 09 printed bash's value too great for base error and still applied the size, writing base-size = 09. 0024 got past the 20px limit, wrote base-size = 0024 and set terminals to 18pt. 016 was written to shell.toml as base-size = 016. On this head, 09 and 016 are stored as 9 and 16, and 0024 is rejected. With only the script reverted to quattro, all three come back and the new test case fails. The slider in the monitor panel and the Dell XPS 13 install step pass plain integers, so they behave as before.

Tests on the worker: ./test/cli passes, and test/shell.d/kitty-config-test.sh passes 4 of 4. This branch is 213 commits behind quattro, so I ran ./test/shell on it merged onto current quattro, which merges cleanly. The only failing files are the five that also fail on quattro alone on this worker: ascii, branding-about-animation, channel-sudo-boundary, first-run and runtime-smoke.

Second opinion from Codex Medium and muse-wonder (via pi, thinking high). Neither found a defect in the change. They agreed the fix is the right size, though their independence from this review is not guaranteed. Two notes from them that don't block anything:

  • The regex still admits arbitrarily long digit strings, and bash arithmetic wraps at 64 bits, so 18446744073709551632 reads as 16. That was already true before this change.
  • In the test, the 016 step runs right after a plain 16 step, so font_size 12.0 and base-size = 16 already hold before it runs. The shell.toml assertion still catches the old behaviour, because quattro writes 016. Using a different size such as 018 would also cover the 08/09 case, where the old code errored out.

#6550 (per-scope sliders) rewrites this same range check and rejects leading zeros outright, so whichever lands second will need a small merge there.

Waiting on the maintainer.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Nov 23, 2026
omarchy display text size 09 tripped bash's octal arithmetic ("value too great for base") and then carried on, 0024 read as octal 20 and so slipped past the 20px limit, and 016 was written to shell.toml as "base-size = 016".
@ThatRetiredDude
ThatRetiredDude force-pushed the display-text-size-leading-zero branch from 7e0f2f9 to 33f47eb Compare November 27, 2026 20:37
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Nov 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

I rechecked the rebased commit 33f47eb9 on an Omarchy ISO worker. On quattro, 09 printed an octal error and wrote base-size = 09, and 0024 slipped past the 20px limit and set Foot to 18pt. This commit writes 9 for 09 and rejects 0024, leaving Foot at 9pt. Both failures returned when I reverted the script.

./test/cli passed, and all eight desktop helper checks passed. The new 018 check failed with the script reverted. Codex reviewed this at high effort. Opus 5.5 High and muse-wonder via pi at high effort agreed the change is clean. Their agreement may reflect access to the same review context.

Before, Foot at 18pt after accepting 0024

After, Foot still at 9pt after rejecting 0024

GitHub is waiting for a maintainer to approve the Tests and Check translation structure workflows for this commit.

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

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants