Repository navigation
Read a text size typed with a leading zero as decimal - #16864
ThatRetiredDude wants to merge 1 commit into
Conversation
[Medium impact] The PR appears safe to merge. SummaryReads zero-padded text sizes as decimal and removes leading zeros before saving settings.
Reviews (2) · Last reviewed commit: "Read a text size typed with a leading ze..." · Reviewed by Greptile |
|
Reviewed and tested at 7e0f2f9. Nothing found to fix. Reproduced on an Omarchy ISO worker with a throwaway home directory. On Tests on the worker: 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:
#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. |
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".
7e0f2f9 to
33f47eb
Compare
|
I rechecked the rebased commit
GitHub is waiting for a maintainer to approve the Tests and Check translation structure workflows for this commit. |


Problem
omarchy-display-text-sizechecks 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(or08,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 0024reads as octal 20, passes the 9–20px range check, and then sets 24px everywhere.awkand the shell read the stored value as decimal.omarchy display text size 016writesbase-size = 016into~/.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 intoshell.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 with016against a temporary home and checks forbase-size = 16inshell.tomlandfont_size 12.0in Kitty's config. It also checks that0024is rejected. Onquattroit fails onbase-size = 016.