Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Output issues with neofetch 7.1.0 on Fedora #1952

Open
Skaldebane opened this issue Nov 10, 2021 · 17 comments · May be fixed by #2084
Open

Output issues with neofetch 7.1.0 on Fedora #1952

Skaldebane opened this issue Nov 10, 2021 · 17 comments · May be fixed by #2084

Comments

@Skaldebane
Copy link

Skaldebane commented Nov 10, 2021

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
Copy link
Author

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
Copy link
Owner

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

@dylanaraps
Copy link
Owner

I cannot reproduce using the provided commands.

@Skaldebane
Copy link
Author

Skaldebane commented Nov 13, 2021

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

@Skaldebane
Copy link
Author

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
Copy link
Author

Skaldebane commented Nov 13, 2021

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
Copy link
Owner

Does the issue occur in a different terminal emulator?

@Skaldebane
Copy link
Author

Skaldebane commented Nov 14, 2021

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
Copy link
Author

Skaldebane commented Nov 14, 2021

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
Copy link
Author

Any updates on this topic?

@dylanaraps
Copy link
Owner

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

@thelfensdrfer
Copy link

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
Copy link

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

@Skaldebane
Copy link
Author

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: "�[38;5;distrom"

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
Copy link
Author

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
Copy link

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
Copy link
Author

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.

Skaldebane added a commit to Skaldebane/neofetch that referenced this issue Mar 28, 2022
This pull request replaces the old broken code (see dylanaraps#1952) with a simpler, working one for `bar_color_total`, just like `bar_color_elapsed`. Let me know if the old code was done that way for a specific purpose.
@Skaldebane Skaldebane linked a pull request Mar 28, 2022 that will close this issue
hykilpikonna referenced this issue in hykilpikonna/hyfetch Jul 30, 2022
Upstream PR: dylanaraps/neofetch#2084
Thanks to @Skaldebane

Co-authored-by: Hossam Elbadissi <skaldebane@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants