Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastfetch makes one tiny error (additional line) in print when not run in terminal start #101

Closed
tomato4 opened this issue Oct 23, 2021 · 24 comments
Labels
bug Something isn't working

Comments

@tomato4
Copy link

tomato4 commented Oct 23, 2021

When I open new terminal, everything works fine.
image

But I have abbreviation for cl = clear; fastfetch. And there it creates one line emtpy and in the end it also creates 1 empty prompt.
image

(and it's not problem of clear - when I run only fastfetch it does the same thing)
image

It's not a big deal. I'm just perfectionist, so it bothers me a little :D
Additional informations about my setup is in the pictures... Or feel free to ask.

Also I tried it on Termite, XTerm, urxvt and it does it in all of these terminals
Also tried Bash instead of Fish and no change. Still does it

@LinusDierheimer
Copy link
Collaborator

Please post the output of fastfetch --show-errors --multithreading false

@tomato4
Copy link
Author

tomato4 commented Oct 23, 2021

image

@LinusDierheimer
Copy link
Collaborator

Does fastfetch --structure Title:Separator:OS:Host:Kernel:Uptime:Packages:Resolution:DE:WM:WMTheme:Theme:Icons:Font:Cursor:Terminal:TerminalFont:CPU:GPU:Memory:Disk:Battery:Locale:Break:Colors have the same issue?

@tomato4
Copy link
Author

tomato4 commented Oct 23, 2021

yes it does

@tomato4
Copy link
Author

tomato4 commented Oct 23, 2021

Well it is fine when I erase "resolution" item. So it's caused because of this module I think
image

@LinusDierheimer
Copy link
Collaborator

Thanks, that makes debugging easier.

@tomato4
Copy link
Author

tomato4 commented Oct 23, 2021

Of course, not a problem.

@LinusDierheimer
Copy link
Collaborator

Let me sum it up so i can be sure:

  • It does work in a newly created terminal as expected
  • If a command was executed before, it has the line
  • It doesn't matter what command was executed before
  • The line always appears after the Shell output, even when multi threading is disabled
  • Removing the shell output doesn't remove the issue
  • Removing the resolution output does tho
  • Same behavior in bash and fish
  • Same behavior in different terminal emulators

If all of that is true, tbh i have no idea what even could be the problem.

@LinusDierheimer
Copy link
Collaborator

Does the following command have the issue?

fastfetch --multithreading false --structure Title:Separator:OS:Host:Kernel:Uptime:Packages:Resolution:DE:WM:WMTheme:Theme:Icons:Font:Cursor:CPU:GPU:Memory:Disk:Battery:Locale:Break:Colors

@tomato4
Copy link
Author

tomato4 commented Oct 24, 2021

Yes, all of that is true. Also it does that on my second device (stable PC) with same OS setup.

Does the following command have the issue?

Yes it does

Maybe I could some day try some debugging myself. I know C a little. But not sure what I can do.

@LinusDierheimer
Copy link
Collaborator

LinusDierheimer commented Oct 24, 2021

The best thing you can try is to go to src/common/detectTerminalShell.c. In line 190 you find static void getShellVersionGeneric(FFstrbuf* exe, const char* exeName, FFstrbuf* version). See if it gets executed. This is the only method that could potentially add a newline to an output. If it does, something is wrong with static void getShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* version).

@tomato4
Copy link
Author

tomato4 commented Oct 24, 2021

Ok I will look at that later. I will comment here once I try figure out something

@LinusDierheimer LinusDierheimer added the bug Something isn't working label Oct 24, 2021
@LinusDierheimer
Copy link
Collaborator

I just fixed a bug in shell code, i don't believe this fixes your problem, but who knows.

@tomato4
Copy link
Author

tomato4 commented Oct 25, 2021

Nope. Still same.

But found out another interesting fact. If I run fastfetch via run.sh it works properly, but if I run directly fastfetch it does not.

PS: I'm still planning to look at that code (especialy the func you recomended to me), but I haven't much time lately...

image
image

@LinusDierheimer
Copy link
Collaborator

This is kinda expected, since calling a shell script spawns a new instance of sh, so running fastfetch through run.sh is always as if fastfetch is the first command to be entert in a terminal.

@LinusDierheimer
Copy link
Collaborator

If you have latest version, can you please post the output of fastfetch --load-config devinfo-verbose?

@tomato4
Copy link
Author

tomato4 commented Oct 25, 2021

image

@LinusDierheimer
Copy link
Collaborator

Output of fastfetch --shell-format "Before {7} After"?

@tomato4
Copy link
Author

tomato4 commented Oct 25, 2021

image

@tomato4
Copy link
Author

tomato4 commented Oct 25, 2021

I have problem to debug the program.
With CLion nor with gdb I'm unable to reproduce the bug in debugging enviroment. As you said earlier:

This is kinda expected, since calling a shell script spawns a new instance of sh, so running fastfetch through run.sh is always as if fastfetch is the first command to be entert in a terminal.

debugger also creates new env, where the program runs perfectly.
If you have any advice, please tell me, but currently I don't know how to debug the program.

Also I have found solution. Kind of... By accident I discovered, that clear; sleep 0.1; fastfetch works perfectly fine. I don't now how's that possible, but it is what it is. It is not clean solution, so if you have any ideas?...

@LinusDierheimer
Copy link
Collaborator

This sounds more like a problem with clear in your terminal emulator than with fastfetch. Is it possible that bug happens with other programs too that output very fast, like clear; cat /proc/cpuinfo?

@tomato4
Copy link
Author

tomato4 commented Oct 26, 2021

well no, because it does it even without clear. Cmd fastfetch will produce bug but sleep 0.1; fastfetch won't. Even without the clear cmd

@LinusDierheimer
Copy link
Collaborator

Closing this for now, maybe it gets fixed in future by luck.

@tomato4
Copy link
Author

tomato4 commented Dec 6, 2021

Actually it was already fixed by luck, but I forget to report it there. Thanks for the effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants