Repository navigation
Colors: fixes --gen-config writing the default background symbol as block - #2784
Open
farisbasha wants to merge 1 commit into
Open
farisbasha wants to merge 1 commit into
farisbasha wants to merge 1 commit into
Conversation
…as `block` ffGenerateColorsJsonConfig() had no case for FF_COLORS_SYMBOL_BACKGROUND, so the default symbol fell through to "block". A full config from --gen-config therefore printed the palette as foreground blocks instead of background cells. Adds the missing case and a test that generates the config for every symbol and reads it back.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Colors module's default
symbolisbackground, butffGenerateColorsJsonConfig()has no case forFF_COLORS_SYMBOL_BACKGROUND, so it falls through todefault:and writes"block". A full config from--gen-config(theotoggle) therefore changes how the palette is printed: background-colored cells become foreground███runs.Repro (Linux):
I found this with a round-trip check over
doc/json_schema.json: set each enum/bool option, generate a full config, and compare what comes back.backgroundwas the only value that did not survive. The others that differed were aliases, such asboth-1written asboth.Related issue (required for new logos for new distros)
None. This is a small bug fix.
Changes
FF_COLORS_SYMBOL_BACKGROUNDcase toffGenerateColorsJsonConfig().tests/colors.c(test-colors). It checks that the default options generate"background", and that every symbol is written under its own name and parsed back to the same value. It fails ondev(default symbol: expected "background", got "block") and passes with the fix.Run on a Linux x86_64 server (Debug build, zig cc / clang,
-DBUILD_TESTS=ON):ctest --output-on-failure: 21/22 pass, including the newtest-colors. The failing one istest-base64: with this toolchain it hits a UBSan trap on the unaligneduint32_tload insrc/common/impl/base64.c, a file this PR does not touch../build/fastfetch -c presets/all.jsonc --stat falseand./build/fastfetch --format jsonboth exit 0."symbol": "background", and both configs print the same palette.colors.c. In the newtests/colors.cit flags the three longfprintf(stderr, ...)lines, the same pattern it flags intests/percent.c.Screenshots
Not a visual change in fastfetch itself. A generated config now prints the same as the default one.
Checklist
This PR was prepared with AI assistance (Claude).