dylanaraps / neofetch

🖼️ A command-line system information tool written in bash 3.2+
MIT License
22.18k stars 1.66k forks source link

Output issues with neofetch 7.1.0 on Fedora #1952

Open Skaldebane opened 3 years ago

Skaldebane commented 3 years ago

Description

Hi! Today I updated neofetch (through dnf), I like the new icon, but... Screenshot from 2021-11-10 07-08-20 What's all this spacing here?

This seems to be happening only when using the infobar memory indicator.

(cmd: neofetch --speed_shorthand on --cpu_temp C --memory_display infobar --disable packages)

Neofetch version

This is neofetch 7.1.0. But again, why do I get these errors when requesting the version? Screenshot from 2021-11-10 07-16-51

Config file

config.conf file

Verbose log

neofetchlog file

Skaldebane commented 3 years ago

This also seems to happen differently if I run the same command normally (note that the cmd above is being run in .bashrc): Screenshot from 2021-11-10 07-31-08

dylanaraps commented 3 years ago

The errors are from running in verbose mode. These are normal. Does the issue occur in master?

dylanaraps commented 3 years ago

I cannot reproduce using the provided commands.

Skaldebane commented 3 years ago

I'll try the master version and reply right away.

Skaldebane commented 3 years ago

I installed the master version in a toolbox Fedora container, still the same issue. It shows this "istrom" inside the memory indicator infobar, plus some line breaks (the line breaks count depends on the situation: .bashrc > normal > verbose (=0)).

Main version downloaded from dnf (through .bashrc): Screenshot from 2021-11-10 07-08-20 (Notice how the line breaks try to fit the terminal height?)


Master version, inside a toolbox container: Screenshot from 2021-11-13 09-28-05


Master version, inside a toolbox container, verbose mode: Screenshot from 2021-11-13 09-28-40

Skaldebane commented 3 years ago

Maybe this has something to do with some external dependency? Or maybe the GNOME Terminal itself?

System: Fedora 34 Workstation. DE: GNOME 40.5 GNOME Terminal: Version 3.40.3 / Using VTE version 0.64.2 +BIDI +GNUTLS +ICU +SYSTEMD

I hope this information can help. Tell me if I'm missing something here.

dylanaraps commented 3 years ago

Does the issue occur in a different terminal emulator?

Skaldebane commented 3 years ago

Tried it on XTerm, same thing (master version): Screenshot from 2021-11-14 09-40-43

Guake: Screenshot from 2021-11-14 09-45-28

Alacritty: Screenshot from 2021-11-14 09-49-02

It also happens on virtual terminals (ctrl-alt-fx).

Seems to be unrelated to the terminal emulator.

Skaldebane commented 3 years ago

I played around with the shell commands inside neofetch and managed to replicate the bar with the same code from neofetch, and it works without problems... Seems like something external adds these characters and line breaks in there? Or interprets something?

It's such a weird bug, as the code seems to be fine, and it always worked on all distros I've ever used, including this exact system before the last update. The 'bar' (bar, infobar, barinfo) memory indicators seem to break something in there.

Skaldebane commented 2 years ago

Any updates on this topic?

dylanaraps commented 2 years ago

Yes. I managed to reproduce this issue. Have not had the time to fix it though.

thelfensdrfer commented 2 years ago

I am having the same issue on rocky linux 8.5. Happy to test/debug the issue with a little pointer in the right direction.

Crinisus commented 2 years ago

I can confirm it happens in both Fedora 35 and 36 Prerelease as well.

Skaldebane commented 2 years ago

I did some debugging, and it seems bar_color_total is where this issue stems from.

Debugging shows this value given to bar_color_total:

image

Value: "istrom"

The first tofu character seems to be the one filling all the space in the terminal.

Weirdly enough, this is coming from the 3rd argument, which is coming from get_args() after the option --bar_colors. We're not even setting it anywhere!

I don't really code in bash, and only have some basic knowledge as any regular Linux user, so I don't really know how to fix this problem. I hope you can find a solution soon 🙏️

Skaldebane commented 2 years ago

Actually, there's a workaround: Simply add --bar_colors without any values to the end of your neofetch command.

This will overwrite the broken value that's automatically added.

Example: neofetch --disable packages --memory_display infobar --bar_colors

image

thelfensdrfer commented 2 years ago

You are right. A temporary fix for me was to change the config from:

bar_color_elapsed="distro"
bar_color_total="distro"

to

# 3 and 4 can be any numbers/colors
bar_color_elapsed="3"
bar_color_total="4"
Skaldebane commented 2 years ago

So this problem is from this code here:

image

Which works just fine for bar_color_elapsed, but not for bar_color_total.

Notice the last line? If the bar_color_total doesn't match the previous two cases, it just passes its current value as it is (which is "distro") to the color() function, which in turn just inserts it inside printf.