Read the FAQ first
Description
Reproduction details:
When the configuration contains display.percent.type including ["num", "num-color"], and the format contains a padding (> or <), the output doesn't display correctly.
My guess is that the padding is being calculated not based in the displayed string, but it is also considering the coloring characters.
I tried to find an existing report, but I wasn't able.
Version used
fastfetch 2.63.1 (x86_64)
Bug prevalence
Always
Regression
Not sure
Installation
Package manager
Package manager
nixpkgs (unstable)
Screenshots
I created a small config-bug.jsonc attached below that reproduces the issue.
In the screenshot below, the first Memory module uses {percentage>3} which I expected to be displayed as 84% which are exactly 3 characters. Instead it erases "84%) | 26.02 G" string that was supposed to be displayed.
The second Memory module uses {percentage}, which displays the correct colored number.
Configuration
System information
Features built-in
fastfetch --list-features
threads
vulkan
wayland
xcb-randr
xrandr
gio
dconf
eet
dbus
imagemagick7
chafa
zlib
sqlite3
egl
glx
opencl
libpulse
libddcutil
libelf
System yyjson
linux/videodev2
Read the FAQ first
Description
Reproduction details:
When the configuration contains
display.percent.typeincluding["num", "num-color"], and the format contains a padding (>or<), the output doesn't display correctly.My guess is that the padding is being calculated not based in the displayed string, but it is also considering the coloring characters.
I tried to find an existing report, but I wasn't able.
Version used
fastfetch 2.63.1 (x86_64)
Bug prevalence
Always
Regression
Not sure
Installation
Package manager
Package manager
nixpkgs (unstable)
Screenshots
I created a small
config-bug.jsoncattached below that reproduces the issue.In the screenshot below, the first Memory module uses
{percentage>3}which I expected to be displayed as84%which are exactly 3 characters. Instead it erases"84%) | 26.02 G"string that was supposed to be displayed.The second Memory module uses
{percentage}, which displays the correct colored number.Configuration
{ "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", "logo": { "type": "none" }, "display": { "separator": " ", "brightColor": false, "percent": { "type": ["bar", "num", "num-color"], "ndigits": 0, "color": { "green":"green", "yellow":"yellow", "red":"red" } }, "bar": { "border": null, "char": { "elapsed": "■", "total": "・" }, "width": 10 } }, "modules": [ { "type": "memory", "key": " Memory ", "keyColor": "blue", "format": "{percentage-bar} ({percentage>3}) {used>9} of {total>9}", "percent": { "green": 30, "yellow": 70 } }, { "type": "memory", "key": " Memory ", "keyColor": "blue", "format": "{percentage-bar} ({percentage}) {used} of {total}", "percent": { "green": 30, "yellow": 70 } } ] }System information
Features built-in